Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 ; Test of global variable reordering. | |
| 2 | |
| 3 ; REQUEST: allow_dump | |
|
jvoung (off chromium)
2015/06/24 17:36:37
I think this should be "REQUIRES" as the keyword i
qining
2015/06/24 20:18:56
Done.
| |
| 4 | |
| 5 ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \ | |
| 6 ; RUN: -i %s --args -sz-seed=1 -O2 -reorder-global-variables \ | |
| 7 ; RUN: | %if --need=target_X8632 --command FileCheck %s --check-prefix=X8632 ASM | |
| 8 | |
| 9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --target x8632 \ | |
| 10 ; RUN: -i %s --disassemble --dis-flags=-rD \ | |
| 11 ; RUN: --args -sz-seed=1 -O2 -reorder-global-variables \ | |
| 12 ; RUN: | %if --need=target_X8632 --command FileCheck %s --check-prefix=X863 2OBJ | |
| 13 | |
| 14 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \ | |
| 15 ; RUN: -i %s --args -sz-seed=1 -O2 -reorder-global-variables --skip-unimplem ented \ | |
|
jvoung (off chromium)
2015/06/24 17:36:37
wrap to 80 cols a little earlier if we are wrappin
qining
2015/06/24 20:18:56
Done.
| |
| 16 ; RUN: | %if --need=target_ARM32 --command FileCheck %s --check-prefix=ARM32 ASM | |
| 17 | |
| 18 ; IAS is not implemented yet. | |
| 19 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \ | |
| 20 ; RUN: -i %s --assemble --disassemble --dis-flags=-rD \ | |
| 21 ; RUN: --args -sz-seed=1 -O2 -reorder-global-variables --skip-unimplemented \ | |
| 22 ; RUN: | %if --need=target_ARM32 --command FileCheck %s --check-prefix=ARM32 OBJ | |
| 23 | |
| 24 ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \ | |
| 25 ; RUN: -i %s --args -sz-seed=1 -Om1 -reorder-global-variables \ | |
| 26 ; RUN: | %if --need=target_X8632 --command FileCheck %s --check-prefix=X8632 ASM | |
| 27 | |
| 28 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --target x8632 \ | |
| 29 ; RUN: -i %s --disassemble --dis-flags=-rD \ | |
| 30 ; RUN: --args -Om1 -sz-seed=1 -reorder-global-variables \ | |
| 31 ; RUN: | %if --need=target_X8632 --command FileCheck %s --check-prefix=X863 2OBJ | |
| 32 | |
| 33 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \ | |
| 34 ; RUN: -i %s --args -sz-seed=1 -Om1 -reorder-global-variables --skip-unimple mented \ | |
| 35 ; RUN: | %if --need=target_ARM32 --command FileCheck %s --check-prefix=ARM32 ASM | |
| 36 | |
| 37 ; IAS is not implemented yet. | |
| 38 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \ | |
| 39 ; RUN: -i %s --assemble --disassemble --dis-flags=-rD \ | |
| 40 ; RUN: --args -sz-seed=1 -Om1 -reorder-global-variables --skip-unimplemented \ | |
| 41 ; RUN: | %if --need=target_ARM32 --command FileCheck %s --check-prefix=ARM32 OBJ | |
| 42 | |
| 43 | |
| 44 define internal i32 @main(i32 %argc, i32 %argv) { | |
| 45 entry: | |
| 46 %expanded1 = ptrtoint [4 x i8]* @PrimitiveInit to i32 | |
| 47 call void @use(i32 %expanded1) | |
| 48 %expanded3 = ptrtoint [4 x i8]* @PrimitiveInitConst to i32 | |
| 49 call void @use(i32 %expanded3) | |
| 50 %expanded5 = ptrtoint [4 x i8]* @PrimitiveInitStatic to i32 | |
| 51 call void @use(i32 %expanded5) | |
| 52 %expanded7 = ptrtoint [4 x i8]* @PrimitiveUninit to i32 | |
| 53 call void @use(i32 %expanded7) | |
| 54 %expanded9 = ptrtoint [20 x i8]* @ArrayInit to i32 | |
| 55 call void @use(i32 %expanded9) | |
| 56 %expanded11 = ptrtoint [40 x i8]* @ArrayInitPartial to i32 | |
| 57 call void @use(i32 %expanded11) | |
| 58 %expanded13 = ptrtoint [20 x i8]* @ArrayUninit to i32 | |
| 59 call void @use(i32 %expanded13) | |
| 60 ret i32 0 | |
| 61 } | |
| 62 declare void @use(i32) | |
| 63 | |
| 64 define internal i32 @nacl_tp_tdb_offset(i32 %__0) { | |
| 65 entry: | |
| 66 ret i32 0 | |
| 67 } | |
| 68 | |
| 69 define internal i32 @nacl_tp_tls_offset(i32 %size) { | |
| 70 entry: | |
| 71 %result = sub i32 0, %size | |
| 72 ret i32 %result | |
| 73 } | |
| 74 | |
| 75 | |
| 76 @PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4 | |
| 77 | |
| 78 @PrimitiveInitConst = internal constant [4 x i8] c"\0D\00\00\00", align 4 | |
| 79 | |
| 80 @ArrayInit = internal global [20 x i8] c"\0A\00\00\00\14\00\00\00\1E\00\00\00(\0 0\00\002\00\00\00", align 4 | |
| 81 | |
| 82 @ArrayInitPartial = internal global [40 x i8] c"<\00\00\00F\00\00\00P\00\00\00Z\ 00\00\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 4 | |
| 83 | |
| 84 @PrimitiveInitStatic = internal global [4 x i8] zeroinitializer, align 4 | |
| 85 | |
| 86 @PrimitiveUninit = internal global [4 x i8] zeroinitializer, align 4 | |
| 87 | |
| 88 @ArrayUninit = internal global [20 x i8] zeroinitializer, align 4 | |
| 89 | |
| 90 @ArrayUninitConstDouble = internal constant [200 x i8] zeroinitializer, align 8 | |
| 91 | |
| 92 @ArrayUninitConstInt = internal constant [20 x i8] zeroinitializer, align 4 | |
| 93 | |
| 94 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 | |
| 95 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 | |
| 96 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 | |
| 97 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 | |
| 98 | |
| 99 ; Make sure the shuffled order is correct. | |
| 100 | |
| 101 ; X8632ASM-LABEL: PrimitiveUninit | |
| 102 ; X8632ASM-LABEL: __init_array_start | |
| 103 ; X8632ASM-LABEL: ArrayUninitConstDouble | |
| 104 ; X8632ASM-LABEL: __tls_template_alignment | |
| 105 ; X8632ASM-LABEL: ArrayInitPartial | |
| 106 ; X8632ASM-LABEL: ArrayUninit | |
| 107 ; X8632ASM-LABEL: ArrayInit | |
| 108 ; X8632ASM-LABEL: __fini_array_start | |
| 109 ; X8632ASM-LABEL: PrimitiveInitStatic | |
| 110 ; X8632ASM-LABEL: ArrayUninitConstInt | |
| 111 ; X8632ASM-LABEL: PrimitiveInit | |
| 112 ; X8632ASM-LABEL: PrimitiveInitConst | |
| 113 ; X8632ASM-LABEL: __tls_template_start | |
| 114 | |
| 115 ; X8632OBJ-LABEL: ArrayInitPartial | |
| 116 ; X8632OBJ-LABEL: ArrayInit | |
| 117 ; X8632OBJ-LABEL: PrimitiveInit | |
| 118 ; X8632OBJ-LABEL: PrimitiveUninit | |
| 119 ; X8632OBJ-LABEL: ArrayUninit | |
| 120 ; X8632OBJ-LABEL: PrimitiveInitStatic | |
| 121 ; X8632OBJ-LABEL: ArrayUninitConstDouble | |
| 122 ; X8632OBJ-LABEL: __tls_template_alignment | |
| 123 ; X8632OBJ-LABEL: ArrayUninitConstInt | |
| 124 ; X8632OBJ-LABEL: PrimitiveInitConst | |
| 125 | |
| 126 ; ARM32ASM-LABEL: PrimitiveUninit | |
| 127 ; ARM32ASM-LABEL: __init_array_start | |
| 128 ; ARM32ASM-LABEL: ArrayUninitConstDouble | |
| 129 ; ARM32ASM-LABEL: __tls_template_alignment | |
| 130 ; ARM32ASM-LABEL: ArrayInitPartial | |
| 131 ; ARM32ASM-LABEL: ArrayUninit | |
| 132 ; ARM32ASM-LABEL: ArrayInit | |
| 133 ; ARM32ASM-LABEL: __fini_array_start | |
| 134 ; ARM32ASM-LABEL: PrimitiveInitStatic | |
| 135 ; ARM32ASM-LABEL: ArrayUninitConstInt | |
| 136 ; ARM32ASM-LABEL: PrimitiveInit | |
| 137 ; ARM32ASM-LABEL: PrimitiveInitConst | |
| 138 ; ARM32ASM-LABEL: __tls_template_start | |
| 139 | |
| 140 ; ARM32OBJ-LABEL: ArrayInitPartial | |
| 141 ; ARM32OBJ-LABEL: ArrayInit | |
| 142 ; ARM32OBJ-LABEL: PrimitiveInit | |
| 143 ; ARM32OBJ-LABEL: PrimitiveUninit | |
| 144 ; ARM32OBJ-LABEL: ArrayUninit | |
| 145 ; ARM32OBJ-LABEL: PrimitiveInitStatic | |
| 146 ; ARM32OBJ-LABEL: ArrayUninitConstDouble | |
| 147 ; ARM32OBJ-LABEL: __tls_template_alignment | |
| 148 ; ARM32OBJ-LABEL: ArrayUninitConstInt | |
| 149 ; ARM32OBJ-LABEL: PrimitiveInitConst | |
| 150 | |
| OLD | NEW |