Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: tests_lit/llvm2ice_tests/globalinit.pnacl.ll

Issue 1180883002: Subzero: Fix lit and cross tests broken in f8b4cc8. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/elf_container.ll ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; Test of global initializers. 1 ; Test of global initializers.
2 2
3 ; REQUIRES: allow_dump 3 ; REQUIRES: allow_dump
4 4
5 ; Test -filetype=asm to test the lea "hack" until we are fully confident 5 ; Test -filetype=asm to test the lea "hack" until we are fully confident
6 ; in -filetype=iasm . 6 ; in -filetype=iasm .
7 ; RUN: %p2i -i %s --filetype=asm --args --verbose none | FileCheck %s 7 ; RUN: %p2i -i %s --filetype=asm --args --verbose none | FileCheck %s
8 8
9 ; Test -filetype=iasm and try to cross reference instructions w/ the 9 ; Test -filetype=iasm and try to cross reference instructions w/ the
10 ; symbol table. 10 ; symbol table.
11 ; RUN: %p2i --assemble --disassemble -i %s --args --verbose none \ 11 ; RUN: %p2i --assemble --disassemble -i %s --args --verbose none \
12 ; RUN: | FileCheck --check-prefix=IAS %s 12 ; RUN: | FileCheck --check-prefix=IAS %s
13 ; RUN: %p2i --assemble --disassemble --dis-flags=-t -i %s --args \ 13 ; RUN: %p2i --assemble --disassemble --dis-flags=-t -i %s --args \
14 ; RUN: --verbose none | FileCheck --check-prefix=SYMTAB %s 14 ; RUN: --verbose none | FileCheck --check-prefix=SYMTAB %s
15 15
16 define internal i32 @main(i32 %argc, i32 %argv) {
17 entry:
18 %expanded1 = ptrtoint [4 x i8]* @PrimitiveInit to i32
19 call void @use(i32 %expanded1)
20 %expanded3 = ptrtoint [4 x i8]* @PrimitiveInitConst to i32
21 call void @use(i32 %expanded3)
22 %expanded5 = ptrtoint [4 x i8]* @PrimitiveInitStatic to i32
23 call void @use(i32 %expanded5)
24 %expanded7 = ptrtoint [4 x i8]* @PrimitiveUninit to i32
25 call void @use(i32 %expanded7)
26 %expanded9 = ptrtoint [20 x i8]* @ArrayInit to i32
27 call void @use(i32 %expanded9)
28 %expanded11 = ptrtoint [40 x i8]* @ArrayInitPartial to i32
29 call void @use(i32 %expanded11)
30 %expanded13 = ptrtoint [20 x i8]* @ArrayUninit to i32
31 call void @use(i32 %expanded13)
32 ret i32 0
33 }
34 ; CHECK-LABEL: main
35 ; CHECK: movl $PrimitiveInit,
36 ; CHECK: movl $PrimitiveInitConst,
37 ; CHECK: movl $PrimitiveInitStatic,
38 ; CHECK: movl $PrimitiveUninit,
39 ; CHECK: movl $ArrayInit,
40 ; CHECK: movl $ArrayInitPartial,
41 ; CHECK: movl $ArrayUninit,
42
43 ; objdump does not indicate what symbol the mov/relocation applies to
44 ; so we grep for "mov {{.*}}, OFFSET, sec", along with
45 ; "OFFSET {{.*}} sec {{.*}} symbol" in the symbol table as a sanity check.
46 ; NOTE: The symbol table sorting has no relation to the code's references.
47 ; IAS-LABEL: main
48 ; SYMTAB-LABEL: SYMBOL TABLE
49
50 ; SYMTAB-DAG: 00000000 {{.*}} .data {{.*}} PrimitiveInit
51 ; IAS: mov {{.*}},0x0 {{.*}} .data
52 ; IAS: call
53
54 ; SYMTAB-DAG: 00000000 {{.*}} .rodata {{.*}} PrimitiveInitConst
55 ; IAS: mov {{.*}},0x0 {{.*}} .rodata
56 ; IAS: call
57
58 ; SYMTAB-DAG: 00000000 {{.*}} .bss {{.*}} PrimitiveInitStatic
59 ; IAS: mov {{.*}},0x0 {{.*}} .bss
60 ; IAS: call
61
62 ; SYMTAB-DAG: 00000004 {{.*}} .bss {{.*}} PrimitiveUninit
63 ; IAS: mov {{.*}},0x4 {{.*}} .bss
64 ; IAS: call
65
66 ; SYMTAB-DAG: 00000004{{.*}}.data{{.*}}ArrayInit
67 ; IAS: mov {{.*}},0x4 {{.*}} .data
68 ; IAS: call
69
70 ; SYMTAB-DAG: 00000018 {{.*}} .data {{.*}} ArrayInitPartial
71 ; IAS: mov {{.*}},0x18 {{.*}} .data
72 ; IAS: call
73
74 ; SYMTAB-DAG: 00000008 {{.*}} .bss {{.*}} ArrayUninit
75 ; IAS: mov {{.*}},0x8 {{.*}} .bss
76 ; IAS: call
77
78
79 declare void @use(i32)
80
81 define internal i32 @nacl_tp_tdb_offset(i32 %__0) {
82 entry:
83 ret i32 0
84 }
85
86 define internal i32 @nacl_tp_tls_offset(i32 %size) {
87 entry:
88 %result = sub i32 0, %size
89 ret i32 %result
90 }
91
92
16 @PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4 93 @PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4
17 ; CHECK: .type PrimitiveInit,@object 94 ; CHECK: .type PrimitiveInit,@object
18 ; CHECK-NEXT: .section .data,"aw",@progbits 95 ; CHECK-NEXT: .section .data,"aw",@progbits
19 ; CHECK-NEXT: .align 4 96 ; CHECK-NEXT: .align 4
20 ; CHECK-NEXT: PrimitiveInit: 97 ; CHECK-NEXT: PrimitiveInit:
21 ; CHECK-NEXT: .byte 98 ; CHECK-NEXT: .byte
22 ; CHECK: .size PrimitiveInit, 4 99 ; CHECK: .size PrimitiveInit, 4
23 100
24 @PrimitiveInitConst = internal constant [4 x i8] c"\0D\00\00\00", align 4 101 @PrimitiveInitConst = internal constant [4 x i8] c"\0D\00\00\00", align 4
25 ; CHECK: .type PrimitiveInitConst,@object 102 ; CHECK: .type PrimitiveInitConst,@object
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ; CHECK: .section .rodata,"a",@progbits 159 ; CHECK: .section .rodata,"a",@progbits
83 ; CHECK-NEXT: .align 4 160 ; CHECK-NEXT: .align 4
84 ; CHECK-NEXT: ArrayUninitConstInt: 161 ; CHECK-NEXT: ArrayUninitConstInt:
85 ; CHECK-NEXT: .zero 20 162 ; CHECK-NEXT: .zero 20
86 ; CHECK-NEXT: .size ArrayUninitConstInt, 20 163 ; CHECK-NEXT: .size ArrayUninitConstInt, 20
87 164
88 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 165 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
89 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 166 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
90 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 167 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8
91 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 168 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4
92
93 define internal i32 @main(i32 %argc, i32 %argv) {
94 entry:
95 %expanded1 = ptrtoint [4 x i8]* @PrimitiveInit to i32
96 call void @use(i32 %expanded1)
97 %expanded3 = ptrtoint [4 x i8]* @PrimitiveInitConst to i32
98 call void @use(i32 %expanded3)
99 %expanded5 = ptrtoint [4 x i8]* @PrimitiveInitStatic to i32
100 call void @use(i32 %expanded5)
101 %expanded7 = ptrtoint [4 x i8]* @PrimitiveUninit to i32
102 call void @use(i32 %expanded7)
103 %expanded9 = ptrtoint [20 x i8]* @ArrayInit to i32
104 call void @use(i32 %expanded9)
105 %expanded11 = ptrtoint [40 x i8]* @ArrayInitPartial to i32
106 call void @use(i32 %expanded11)
107 %expanded13 = ptrtoint [20 x i8]* @ArrayUninit to i32
108 call void @use(i32 %expanded13)
109 ret i32 0
110 }
111 ; CHECK-LABEL: main
112 ; CHECK: movl $PrimitiveInit,
113 ; CHECK: movl $PrimitiveInitConst,
114 ; CHECK: movl $PrimitiveInitStatic,
115 ; CHECK: movl $PrimitiveUninit,
116 ; CHECK: movl $ArrayInit,
117 ; CHECK: movl $ArrayInitPartial,
118 ; CHECK: movl $ArrayUninit,
119
120 ; objdump does not indicate what symbol the mov/relocation applies to
121 ; so we grep for "mov {{.*}}, OFFSET, sec", along with
122 ; "OFFSET {{.*}} sec {{.*}} symbol" in the symbol table as a sanity check.
123 ; NOTE: The symbol table sorting has no relation to the code's references.
124 ; IAS-LABEL: main
125 ; SYMTAB-LABEL: SYMBOL TABLE
126
127 ; SYMTAB-DAG: 00000000 {{.*}} .data {{.*}} PrimitiveInit
128 ; IAS: mov {{.*}},0x0 {{.*}} .data
129 ; IAS: call
130
131 ; SYMTAB-DAG: 00000000 {{.*}} .rodata {{.*}} PrimitiveInitConst
132 ; IAS: mov {{.*}},0x0 {{.*}} .rodata
133 ; IAS: call
134
135 ; SYMTAB-DAG: 00000000 {{.*}} .bss {{.*}} PrimitiveInitStatic
136 ; IAS: mov {{.*}},0x0 {{.*}} .bss
137 ; IAS: call
138
139 ; SYMTAB-DAG: 00000004 {{.*}} .bss {{.*}} PrimitiveUninit
140 ; IAS: mov {{.*}},0x4 {{.*}} .bss
141 ; IAS: call
142
143 ; SYMTAB-DAG: 00000004{{.*}}.data{{.*}}ArrayInit
144 ; IAS: mov {{.*}},0x4 {{.*}} .data
145 ; IAS: call
146
147 ; SYMTAB-DAG: 00000018 {{.*}} .data {{.*}} ArrayInitPartial
148 ; IAS: mov {{.*}},0x18 {{.*}} .data
149 ; IAS: call
150
151 ; SYMTAB-DAG: 00000008 {{.*}} .bss {{.*}} ArrayUninit
152 ; IAS: mov {{.*}},0x8 {{.*}} .bss
153 ; IAS: call
154
155
156 declare void @use(i32)
157
158 define internal i32 @nacl_tp_tdb_offset(i32 %__0) {
159 entry:
160 ret i32 0
161 }
162
163 define internal i32 @nacl_tp_tls_offset(i32 %size) {
164 entry:
165 %result = sub i32 0, %size
166 ret i32 %result
167 }
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/elf_container.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698