OLD | NEW |
1 ; Test of global initializers. | 1 ; Test of global initializers. |
2 | 2 |
3 ; REQUIRES: allow_dump | 3 ; REQUIRES: allow_dump |
4 | 4 |
5 ; Test initializers with -filetype=asm. | 5 ; Test initializers with -filetype=asm. |
6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \ | 6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \ |
7 ; RUN: -i %s --args -O2 -allow-externally-defined-symbols \ | 7 ; RUN: -i %s --args -O2 -allow-externally-defined-symbols \ |
8 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 8 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
9 | 9 |
10 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \ | 10 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \ |
(...skipping 26 matching lines...) Expand all Loading... |
37 ; RUN: -allow-externally-defined-symbols \ | 37 ; RUN: -allow-externally-defined-symbols \ |
38 ; RUN: | %if --need=target_ARM32 --command FileCheck \ | 38 ; RUN: | %if --need=target_ARM32 --command FileCheck \ |
39 ; RUN: --check-prefix=IASARM32 %s | 39 ; RUN: --check-prefix=IASARM32 %s |
40 | 40 |
41 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --assemble \ | 41 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --assemble \ |
42 ; RUN: --disassemble --dis-flags=-t --target arm32 -i %s \ | 42 ; RUN: --disassemble --dis-flags=-t --target arm32 -i %s \ |
43 ; RUN: --args --verbose none \ | 43 ; RUN: --args --verbose none \ |
44 ; RUN: -allow-externally-defined-symbols \ | 44 ; RUN: -allow-externally-defined-symbols \ |
45 ; RUN: | %if --need=target_ARM32 --command FileCheck --check-prefix=SYMTAB %s | 45 ; RUN: | %if --need=target_ARM32 --command FileCheck --check-prefix=SYMTAB %s |
46 | 46 |
| 47 ; RUN: %if --need=target_MIPS32 --need=allow_dump \ |
| 48 ; RUN: --command %p2i --filetype=asm --assemble --disassemble --target \ |
| 49 ; RUN: mips32 -i %s --args -O2 -allow-externally-defined-symbols \ |
| 50 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ |
| 51 ; RUN: --command FileCheck --check-prefix=IASMIPS32 %s |
| 52 |
| 53 ; RUN: %if --need=target_MIPS32 --need=allow_dump --command %p2i \ |
| 54 ; RUN: --filetype=asm --assemble --disassemble --dis-flags=-t \ |
| 55 ; RUN: --target mips32 -i %s --args --verbose none \ |
| 56 ; RUN: -allow-externally-defined-symbols \ |
| 57 ; RUN: | %if --need=target_MIPS32 --need=allow_dump \ |
| 58 ; RUN: --command FileCheck --check-prefix=SYMTAB %s |
| 59 |
47 define internal i32 @main(i32 %argc, i32 %argv) { | 60 define internal i32 @main(i32 %argc, i32 %argv) { |
48 entry: | 61 entry: |
49 %expanded1 = ptrtoint [4 x i8]* @PrimitiveInit to i32 | 62 %expanded1 = ptrtoint [4 x i8]* @PrimitiveInit to i32 |
50 call void @use(i32 %expanded1) | 63 call void @use(i32 %expanded1) |
51 %expanded3 = ptrtoint [4 x i8]* @PrimitiveInitConst to i32 | 64 %expanded3 = ptrtoint [4 x i8]* @PrimitiveInitConst to i32 |
52 call void @use(i32 %expanded3) | 65 call void @use(i32 %expanded3) |
53 %expanded5 = ptrtoint [4 x i8]* @PrimitiveInitStatic to i32 | 66 %expanded5 = ptrtoint [4 x i8]* @PrimitiveInitStatic to i32 |
54 call void @use(i32 %expanded5) | 67 call void @use(i32 %expanded5) |
55 %expanded7 = ptrtoint [4 x i8]* @PrimitiveUninit to i32 | 68 %expanded7 = ptrtoint [4 x i8]* @PrimitiveUninit to i32 |
56 call void @use(i32 %expanded7) | 69 call void @use(i32 %expanded7) |
(...skipping 20 matching lines...) Expand all Loading... |
77 ; NOTE: The symbol table sorting has no relation to the code's references. | 90 ; NOTE: The symbol table sorting has no relation to the code's references. |
78 ; IAS-LABEL: main | 91 ; IAS-LABEL: main |
79 ; SYMTAB-LABEL: SYMBOL TABLE | 92 ; SYMTAB-LABEL: SYMBOL TABLE |
80 | 93 |
81 ; SYMTAB-DAG: 00000000 {{.*}} .data {{.*}} PrimitiveInit | 94 ; SYMTAB-DAG: 00000000 {{.*}} .data {{.*}} PrimitiveInit |
82 ; IAS: mov {{.*}},0x0 {{.*}} .data | 95 ; IAS: mov {{.*}},0x0 {{.*}} .data |
83 ; IAS: call | 96 ; IAS: call |
84 ; IASARM32: movw {{.*}} PrimitiveInit | 97 ; IASARM32: movw {{.*}} PrimitiveInit |
85 ; IASARM32: movt {{.*}} PrimitiveInit | 98 ; IASARM32: movt {{.*}} PrimitiveInit |
86 ; IASARM32: bl | 99 ; IASARM32: bl |
| 100 ; IASMIPS32: lui {{.*}} PrimitiveInit |
| 101 ; IASMIPS32: addiu {{.*}} PrimitiveInit |
| 102 ; IASMIPS32: jal |
87 | 103 |
88 ; SYMTAB-DAG: 00000000 {{.*}} .rodata {{.*}} PrimitiveInitConst | 104 ; SYMTAB-DAG: 00000000 {{.*}} .rodata {{.*}} PrimitiveInitConst |
89 ; IAS: mov {{.*}},0x0 {{.*}} .rodata | 105 ; IAS: mov {{.*}},0x0 {{.*}} .rodata |
90 ; IAS: call | 106 ; IAS: call |
91 ; IASARM32: movw {{.*}} PrimitiveInitConst | 107 ; IASARM32: movw {{.*}} PrimitiveInitConst |
92 ; IASARM32: movt {{.*}} PrimitiveInitConst | 108 ; IASARM32: movt {{.*}} PrimitiveInitConst |
93 ; IASARM32: bl | 109 ; IASARM32: bl |
| 110 ; IASMIPS32: lui {{.*}} PrimitiveInitConst |
| 111 ; IASMIPS32: addiu {{.*}} PrimitiveInitConst |
| 112 ; IASMIPS32: jal |
94 | 113 |
95 ; SYMTAB-DAG: 00000000 {{.*}} .bss {{.*}} PrimitiveInitStatic | 114 ; SYMTAB-DAG: 00000000 {{.*}} .bss {{.*}} PrimitiveInitStatic |
96 ; IAS: mov {{.*}},0x0 {{.*}} .bss | 115 ; IAS: mov {{.*}},0x0 {{.*}} .bss |
97 ; IAS: call | 116 ; IAS: call |
98 ; IASARM32: movw {{.*}} PrimitiveInitStatic | 117 ; IASARM32: movw {{.*}} PrimitiveInitStatic |
99 ; IASARM32: movt {{.*}} PrimitiveInitStatic | 118 ; IASARM32: movt {{.*}} PrimitiveInitStatic |
100 ; IASARM32: bl | 119 ; IASARM32: bl |
| 120 ; IASMIPS32: lui {{.*}} PrimitiveInitStatic |
| 121 ; IASMIPS32: addiu {{.*}} PrimitiveInitStatic |
| 122 ; IASMIPS32: jal |
101 | 123 |
102 ; SYMTAB-DAG: 00000004 {{.*}} .bss {{.*}} PrimitiveUninit | 124 ; SYMTAB-DAG: 00000004 {{.*}} .bss {{.*}} PrimitiveUninit |
103 ; IAS: mov {{.*}},0x4 {{.*}} .bss | 125 ; IAS: mov {{.*}},0x4 {{.*}} .bss |
104 ; IAS: call | 126 ; IAS: call |
105 ; IASARM32: movw {{.*}} PrimitiveUninit | 127 ; IASARM32: movw {{.*}} PrimitiveUninit |
106 ; IASARM32: movt {{.*}} PrimitiveUninit | 128 ; IASARM32: movt {{.*}} PrimitiveUninit |
107 ; IASARM32: bl | 129 ; IASARM32: bl |
| 130 ; IASMIPS32: lui {{.*}} PrimitiveUninit |
| 131 ; IASMIPS32: addiu {{.*}} PrimitiveUninit |
| 132 ; IASMIPS32: jal |
108 | 133 |
109 ; SYMTAB-DAG: 00000004{{.*}}.data{{.*}}ArrayInit | 134 ; SYMTAB-DAG: 00000004{{.*}}.data{{.*}}ArrayInit |
110 ; IAS: mov {{.*}},0x4 {{.*}} .data | 135 ; IAS: mov {{.*}},0x4 {{.*}} .data |
111 ; IAS: call | 136 ; IAS: call |
112 ; IASARM32: movw {{.*}} ArrayInit | 137 ; IASARM32: movw {{.*}} ArrayInit |
113 ; IASARM32: movt {{.*}} ArrayInit | 138 ; IASARM32: movt {{.*}} ArrayInit |
114 ; IASARM32: bl | 139 ; IASARM32: bl |
| 140 ; IASMIPS32: lui {{.*}} ArrayInit |
| 141 ; IASMIPS32: addiu {{.*}} ArrayInit |
| 142 ; IASMIPS32: jal |
115 | 143 |
116 ; SYMTAB-DAG: 00000018 {{.*}} .data {{.*}} ArrayInitPartial | 144 ; SYMTAB-DAG: 00000018 {{.*}} .data {{.*}} ArrayInitPartial |
117 ; IAS: mov {{.*}},0x18 {{.*}} .data | 145 ; IAS: mov {{.*}},0x18 {{.*}} .data |
118 ; IAS: call | 146 ; IAS: call |
119 ; IASARM32: movw {{.*}} ArrayInitPartial | 147 ; IASARM32: movw {{.*}} ArrayInitPartial |
120 ; IASARM32: movt {{.*}} ArrayInitPartial | 148 ; IASARM32: movt {{.*}} ArrayInitPartial |
121 ; IASARM32: bl | 149 ; IASARM32: bl |
| 150 ; IASMIPS32: lui {{.*}} ArrayInitPartial |
| 151 ; IASMIPS32: addiu {{.*}} ArrayInitPartial |
| 152 ; IASMIPS32: jal |
122 | 153 |
123 ; SYMTAB-DAG: 00000008 {{.*}} .bss {{.*}} ArrayUninit | 154 ; SYMTAB-DAG: 00000008 {{.*}} .bss {{.*}} ArrayUninit |
124 ; IAS: mov {{.*}},0x8 {{.*}} .bss | 155 ; IAS: mov {{.*}},0x8 {{.*}} .bss |
125 ; IAS: call | 156 ; IAS: call |
126 ; IASARM32: movw {{.*}} ArrayUninit | 157 ; IASARM32: movw {{.*}} ArrayUninit |
127 ; IASARM32: movt {{.*}} ArrayUninit | 158 ; IASARM32: movt {{.*}} ArrayUninit |
128 ; IASARM32: bl | 159 ; IASARM32: bl |
| 160 ; IASMIPS32: lui {{.*}} ArrayUninit |
| 161 ; IASMIPS32: addiu {{.*}} ArrayUninit |
| 162 ; IASMIPS32: jal |
129 | 163 |
130 declare void @use(i32) | 164 declare void @use(i32) |
131 | 165 |
132 define internal i32 @nacl_tp_tdb_offset(i32 %__0) { | 166 define internal i32 @nacl_tp_tdb_offset(i32 %__0) { |
133 entry: | 167 entry: |
134 ret i32 0 | 168 ret i32 0 |
135 } | 169 } |
136 | 170 |
137 define internal i32 @nacl_tp_tls_offset(i32 %size) { | 171 define internal i32 @nacl_tp_tls_offset(i32 %size) { |
138 entry: | 172 entry: |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 ; CHECK: .section .rodata,"a",%progbits | 244 ; CHECK: .section .rodata,"a",%progbits |
211 ; CHECK-NEXT: .p2align 2 | 245 ; CHECK-NEXT: .p2align 2 |
212 ; CHECK-NEXT: ArrayUninitConstInt: | 246 ; CHECK-NEXT: ArrayUninitConstInt: |
213 ; CHECK-NEXT: .zero 20 | 247 ; CHECK-NEXT: .zero 20 |
214 ; CHECK-NEXT: .size ArrayUninitConstInt, 20 | 248 ; CHECK-NEXT: .size ArrayUninitConstInt, 20 |
215 | 249 |
216 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 | 250 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 |
217 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 | 251 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 |
218 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 | 252 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 |
219 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 | 253 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 |
OLD | NEW |