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

Side by Side Diff: tests_lit/llvm2ice_tests/globalrelocs.ll

Issue 1188603002: Move lowerGlobal() from target-specific code to emitGlobal() in generic code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: .long vs .4byte 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/globalinit.pnacl.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 ; Tests if we handle global variables with relocation initializers. 1 ; Tests if we handle global variables with relocation initializers.
2 2
3 ; REQUIRES: allow_dump 3 ; REQUIRES: allow_dump
4 4
5 ; Test that we handle it in the ICE converter. 5 ; Test that we handle it in the ICE converter.
6 ; RUN: %lc2i -i %s --args -verbose inst -threads=0 \ 6 ; RUN: %lc2i -i %s --args -verbose inst -threads=0 \
7 ; RUN: | %iflc FileCheck %s 7 ; RUN: | %iflc FileCheck %s
8 ; RUN: %lc2i -i %s --args -verbose inst -threads=0 \ 8 ; RUN: %lc2i -i %s --args -verbose inst -threads=0 \
9 ; RUN: | %iflc FileCheck --check-prefix=DUMP %s 9 ; RUN: | %iflc FileCheck --check-prefix=DUMP %s
10 10
11 ; Test that we handle it using Subzero's bitcode reader. 11 ; Test that we handle it using Subzero's bitcode reader.
12 ; RUN: %p2i -i %s --args -verbose inst -threads=0 \ 12 ; RUN: %p2i -i %s --args -verbose inst -threads=0 \
13 ; RUN: | FileCheck %s 13 ; RUN: | FileCheck %s
14 ; RUN: %p2i -i %s --args -verbose inst -threads=0 \ 14 ; RUN: %p2i -i %s --args -verbose inst -threads=0 \
15 ; RUN: | FileCheck --check-prefix=DUMP %s 15 ; RUN: | FileCheck --check-prefix=DUMP %s
16 16
17 @bytes = internal global [7 x i8] c"abcdefg" 17 @bytes = internal global [7 x i8] c"abcdefg"
18 ; DUMP: @bytes = internal global [7 x i8] c"abcdefg" 18 ; DUMP: @bytes = internal global [7 x i8] c"abcdefg"
19 ; CHECK:» .type» bytes,@object 19 ; CHECK:» .type» bytes,%object
20 ; CHECK:» .section» .data,"aw",@progbits 20 ; CHECK:» .section» .data,"aw",%progbits
21 ; CHECK:bytes: 21 ; CHECK:bytes:
22 ; CHECK: .byte 97 22 ; CHECK: .byte 97
23 ; CHECK: .byte 98 23 ; CHECK: .byte 98
24 ; CHECK: .byte 99 24 ; CHECK: .byte 99
25 ; CHECK: .byte 100 25 ; CHECK: .byte 100
26 ; CHECK: .byte 101 26 ; CHECK: .byte 101
27 ; CHECK: .byte 102 27 ; CHECK: .byte 102
28 ; CHECK: .byte 103 28 ; CHECK: .byte 103
29 ; CHECK: .size bytes, 7 29 ; CHECK: .size bytes, 7
30 30
31 @const_bytes = internal constant [7 x i8] c"abcdefg" 31 @const_bytes = internal constant [7 x i8] c"abcdefg"
32 ; DUMP: @const_bytes = internal constant [7 x i8] c"abcdefg" 32 ; DUMP: @const_bytes = internal constant [7 x i8] c"abcdefg"
33 ; CHECK:» .type» const_bytes,@object 33 ; CHECK:» .type» const_bytes,%object
34 ; CHECK:» .section» .rodata,"a",@progbits 34 ; CHECK:» .section» .rodata,"a",%progbits
35 ; CHECK:const_bytes: 35 ; CHECK:const_bytes:
36 ; CHECK: .byte 97 36 ; CHECK: .byte 97
37 ; CHECK: .byte 98 37 ; CHECK: .byte 98
38 ; CHECK: .byte 99 38 ; CHECK: .byte 99
39 ; CHECK: .byte 100 39 ; CHECK: .byte 100
40 ; CHECK: .byte 101 40 ; CHECK: .byte 101
41 ; CHECK: .byte 102 41 ; CHECK: .byte 102
42 ; CHECK: .byte 103 42 ; CHECK: .byte 103
43 ; CHECK: .size const_bytes, 7 43 ; CHECK: .size const_bytes, 7
44 44
45 @ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32) 45 @ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32)
46 ; DUMP: @ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32) 46 ; DUMP: @ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32)
47 ; CHECK:» .type» ptr_to_ptr,@object 47 ; CHECK:» .type» ptr_to_ptr,%object
48 ; CHECK:» .section» .data,"aw",@progbits 48 ; CHECK:» .section» .data,"aw",%progbits
49 ; CHECK:ptr_to_ptr: 49 ; CHECK:ptr_to_ptr:
50 ; CHECK: .long ptr 50 ; CHECK: .long ptr
51 ; CHECK: .size ptr_to_ptr, 4 51 ; CHECK: .size ptr_to_ptr, 4
52 52
53 @const_ptr_to_ptr = internal constant i32 ptrtoint (i32* @ptr to i32) 53 @const_ptr_to_ptr = internal constant i32 ptrtoint (i32* @ptr to i32)
54 ; DUMP: @const_ptr_to_ptr = internal constant i32 ptrtoint (i32* @ptr to i32) 54 ; DUMP: @const_ptr_to_ptr = internal constant i32 ptrtoint (i32* @ptr to i32)
55 ; CHECK:» .type» const_ptr_to_ptr,@object 55 ; CHECK:» .type» const_ptr_to_ptr,%object
56 ; CHECK:» .section» .rodata,"a",@progbits 56 ; CHECK:» .section» .rodata,"a",%progbits
57 ; CHECK:const_ptr_to_ptr: 57 ; CHECK:const_ptr_to_ptr:
58 ; CHECK: .long ptr 58 ; CHECK: .long ptr
59 ; CHECK: .size const_ptr_to_ptr, 4 59 ; CHECK: .size const_ptr_to_ptr, 4
60 60
61 @ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32) 61 @ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32)
62 ; DUMP: @ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32) 62 ; DUMP: @ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32)
63 ; CHECK:» .type» ptr_to_func,@object 63 ; CHECK:» .type» ptr_to_func,%object
64 ; CHECK:» .section» .data,"aw",@progbits 64 ; CHECK:» .section» .data,"aw",%progbits
65 ; CHECK:ptr_to_func: 65 ; CHECK:ptr_to_func:
66 ; CHECK: .long func 66 ; CHECK: .long func
67 ; CHECK: .size ptr_to_func, 4 67 ; CHECK: .size ptr_to_func, 4
68 68
69 @const_ptr_to_func = internal constant i32 ptrtoint (void ()* @func to i32) 69 @const_ptr_to_func = internal constant i32 ptrtoint (void ()* @func to i32)
70 ; DUMP: @const_ptr_to_func = internal constant i32 ptrtoint (void ()* @func to i 32) 70 ; DUMP: @const_ptr_to_func = internal constant i32 ptrtoint (void ()* @func to i 32)
71 ; CHECK:» .type» const_ptr_to_func,@object 71 ; CHECK:» .type» const_ptr_to_func,%object
72 ; CHECK:» .section» .rodata,"a",@progbits 72 ; CHECK:» .section» .rodata,"a",%progbits
73 ; CHECK:const_ptr_to_func: 73 ; CHECK:const_ptr_to_func:
74 ; CHECK: .long func 74 ; CHECK: .long func
75 ; CHECK: .size const_ptr_to_func, 4 75 ; CHECK: .size const_ptr_to_func, 4
76 76
77 @compound = internal global <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }> 77 @compound = internal global <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
78 ; DUMP: @compound = internal global <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }> 78 ; DUMP: @compound = internal global <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
79 ; CHECK:» .type» compound,@object 79 ; CHECK:» .type» compound,%object
80 ; CHECK:» .section» .data,"aw",@progbits 80 ; CHECK:» .section» .data,"aw",%progbits
81 ; CHECK:compound: 81 ; CHECK:compound:
82 ; CHECK: .byte 102 82 ; CHECK: .byte 102
83 ; CHECK: .byte 111 83 ; CHECK: .byte 111
84 ; CHECK: .byte 111 84 ; CHECK: .byte 111
85 ; CHECK: .long func 85 ; CHECK: .long func
86 ; CHECK: .size compound, 7 86 ; CHECK: .size compound, 7
87 87
88 @const_compound = internal constant <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }> 88 @const_compound = internal constant <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
89 ; DUMP: @const_compound = internal constant <{ [3 x i8], i32 }> <{ [3 x i8] c"fo o", i32 ptrtoint (void ()* @func to i32) }> 89 ; DUMP: @const_compound = internal constant <{ [3 x i8], i32 }> <{ [3 x i8] c"fo o", i32 ptrtoint (void ()* @func to i32) }>
90 ; CHECK:» .type» const_compound,@object 90 ; CHECK:» .type» const_compound,%object
91 ; CHECK:» .section» .rodata,"a",@progbits 91 ; CHECK:» .section» .rodata,"a",%progbits
92 ; CHECK:const_compound: 92 ; CHECK:const_compound:
93 ; CHECK: .byte 102 93 ; CHECK: .byte 102
94 ; CHECK: .byte 111 94 ; CHECK: .byte 111
95 ; CHECK: .byte 111 95 ; CHECK: .byte 111
96 ; CHECK: .long func 96 ; CHECK: .long func
97 ; CHECK: .size const_compound, 7 97 ; CHECK: .size const_compound, 7
98 98
99 @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32) 99 @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32)
100 ; DUMP: @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32) 100 ; DUMP: @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32)
101 ; CHECK:» .type» ptr,@object 101 ; CHECK:» .type» ptr,%object
102 ; CHECK:» .section» .data,"aw",@progbits 102 ; CHECK:» .section» .data,"aw",%progbits
103 ; CHECK:ptr: 103 ; CHECK:ptr:
104 ; CHECK: .long bytes 104 ; CHECK: .long bytes
105 ; CHECK: .size ptr, 4 105 ; CHECK: .size ptr, 4
106 106
107 @const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32) 107 @const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32)
108 ; DUMP: @const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32) 108 ; DUMP: @const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32)
109 ; CHECK:» .type» const_ptr,@object 109 ; CHECK:» .type» const_ptr,%object
110 ; CHECK:» .section» .rodata,"a",@progbits 110 ; CHECK:» .section» .rodata,"a",%progbits
111 ; CHECK:const_ptr: 111 ; CHECK:const_ptr:
112 ; CHECK: .long bytes 112 ; CHECK: .long bytes
113 ; CHECK: .size const_ptr, 4 113 ; CHECK: .size const_ptr, 4
114 114
115 @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1) 115 @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1)
116 ; DUMP: @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1) 116 ; DUMP: @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1)
117 ; CHECK:» .type» addend_ptr,@object 117 ; CHECK:» .type» addend_ptr,%object
118 ; CHECK:» .section» .data,"aw",@progbits 118 ; CHECK:» .section» .data,"aw",%progbits
119 ; CHECK:addend_ptr: 119 ; CHECK:addend_ptr:
120 ; CHECK: .long ptr + 1 120 ; CHECK: .long ptr + 1
121 ; CHECK: .size addend_ptr, 4 121 ; CHECK: .size addend_ptr, 4
122 122
123 @const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1) 123 @const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1)
124 ; DUMP: @const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr t o i32), i32 1) 124 ; DUMP: @const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr t o i32), i32 1)
125 ; CHECK:» .type» const_addend_ptr,@object 125 ; CHECK:» .type» const_addend_ptr,%object
126 ; CHECK:» .section» .rodata,"a",@progbits 126 ; CHECK:» .section» .rodata,"a",%progbits
127 ; CHECK:const_addend_ptr: 127 ; CHECK:const_addend_ptr:
128 ; CHECK: .long ptr + 1 128 ; CHECK: .long ptr + 1
129 ; CHECK: .size const_addend_ptr, 4 129 ; CHECK: .size const_addend_ptr, 4
130 130
131 @addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1) 131 @addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1)
132 ; DUMP: @addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i 32), i32 -1) 132 ; DUMP: @addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i 32), i32 -1)
133 ; CHECK:» .type» addend_negative,@object 133 ; CHECK:» .type» addend_negative,%object
134 ; CHECK:» .section» .data,"aw",@progbits 134 ; CHECK:» .section» .data,"aw",%progbits
135 ; CHECK:addend_negative: 135 ; CHECK:addend_negative:
136 ; CHECK: .long ptr - 1 136 ; CHECK: .long ptr - 1
137 ; CHECK: .size addend_negative, 4 137 ; CHECK: .size addend_negative, 4
138 138
139 @const_addend_negative = internal constant i32 add (i32 ptrtoint (i32* @ptr to i 32), i32 -1) 139 @const_addend_negative = internal constant i32 add (i32 ptrtoint (i32* @ptr to i 32), i32 -1)
140 ; DUMP: @const_addend_negative = internal constant i32 add (i32 ptrtoint (i32* @ ptr to i32), i32 -1) 140 ; DUMP: @const_addend_negative = internal constant i32 add (i32 ptrtoint (i32* @ ptr to i32), i32 -1)
141 ; CHECK:» .type» const_addend_negative,@object 141 ; CHECK:» .type» const_addend_negative,%object
142 ; CHECK:» .section» .rodata,"a",@progbits 142 ; CHECK:» .section» .rodata,"a",%progbits
143 ; CHECK:const_addend_negative: 143 ; CHECK:const_addend_negative:
144 ; CHECK: .long ptr - 1 144 ; CHECK: .long ptr - 1
145 ; CHECK: .size const_addend_negative, 4 145 ; CHECK: .size const_addend_negative, 4
146 146
147 @addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 1) 147 @addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 1)
148 ; DUMP: @addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1) 148 ; DUMP: @addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1)
149 ; CHECK:» .type» addend_array1,@object 149 ; CHECK:» .type» addend_array1,%object
150 ; CHECK:» .section» .data,"aw",@progbits 150 ; CHECK:» .section» .data,"aw",%progbits
151 ; CHECK:addend_array1: 151 ; CHECK:addend_array1:
152 ; CHECK: .long bytes + 1 152 ; CHECK: .long bytes + 1
153 ; CHECK: .size addend_array1, 4 153 ; CHECK: .size addend_array1, 4
154 154
155 @const_addend_array1 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1) 155 @const_addend_array1 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1)
156 ; DUMP: @const_addend_array1 = internal constant i32 add (i32 ptrtoint ([7 x i8] * @bytes to i32), i32 1) 156 ; DUMP: @const_addend_array1 = internal constant i32 add (i32 ptrtoint ([7 x i8] * @bytes to i32), i32 1)
157 ; CHECK:» .type» const_addend_array1,@object 157 ; CHECK:» .type» const_addend_array1,%object
158 ; CHECK:» .section» .rodata,"a",@progbits 158 ; CHECK:» .section» .rodata,"a",%progbits
159 ; CHECK:const_addend_array1: 159 ; CHECK:const_addend_array1:
160 ; CHECK: .long bytes + 1 160 ; CHECK: .long bytes + 1
161 ; CHECK: .size const_addend_array1, 4 161 ; CHECK: .size const_addend_array1, 4
162 162
163 @addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 7) 163 @addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 7)
164 ; DUMP: @addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7) 164 ; DUMP: @addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7)
165 ; CHECK:» .type» addend_array2,@object 165 ; CHECK:» .type» addend_array2,%object
166 ; CHECK:» .section» .data,"aw",@progbits 166 ; CHECK:» .section» .data,"aw",%progbits
167 ; CHECK:addend_array2: 167 ; CHECK:addend_array2:
168 ; CHECK: .long bytes + 7 168 ; CHECK: .long bytes + 7
169 ; CHECK: .size addend_array2, 4 169 ; CHECK: .size addend_array2, 4
170 170
171 @const_addend_array2 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7) 171 @const_addend_array2 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7)
172 ; DUMP: @const_addend_array2 = internal constant i32 add (i32 ptrtoint ([7 x i8] * @bytes to i32), i32 7) 172 ; DUMP: @const_addend_array2 = internal constant i32 add (i32 ptrtoint ([7 x i8] * @bytes to i32), i32 7)
173 ; CHECK:» .type» const_addend_array2,@object 173 ; CHECK:» .type» const_addend_array2,%object
174 ; CHECK:» .section» .rodata,"a",@progbits 174 ; CHECK:» .section» .rodata,"a",%progbits
175 ; CHECK:const_addend_array2: 175 ; CHECK:const_addend_array2:
176 ; CHECK: .long bytes + 7 176 ; CHECK: .long bytes + 7
177 ; CHECK: .size const_addend_array2, 4 177 ; CHECK: .size const_addend_array2, 4
178 178
179 @addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 9) 179 @addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32) , i32 9)
180 ; DUMP: @addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9) 180 ; DUMP: @addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9)
181 ; CHECK:» .type» addend_array3,@object 181 ; CHECK:» .type» addend_array3,%object
182 ; CHECK:» .section» .data,"aw",@progbits 182 ; CHECK:» .section» .data,"aw",%progbits
183 ; CHECK:addend_array3: 183 ; CHECK:addend_array3:
184 ; CHECK: .long bytes + 9 184 ; CHECK: .long bytes + 9
185 ; CHECK: .size addend_array3, 4 185 ; CHECK: .size addend_array3, 4
186 186
187 @const_addend_array3 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9) 187 @const_addend_array3 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9)
188 ; DUMP: @const_addend_array3 = internal constant i32 add (i32 ptrtoint ([7 x i8] * @bytes to i32), i32 9) 188 ; DUMP: @const_addend_array3 = internal constant i32 add (i32 ptrtoint ([7 x i8] * @bytes to i32), i32 9)
189 ; CHECK:» .type» const_addend_array3,@object 189 ; CHECK:» .type» const_addend_array3,%object
190 ; CHECK:» .section» .rodata,"a",@progbits 190 ; CHECK:» .section» .rodata,"a",%progbits
191 ; CHECK:const_addend_array3: 191 ; CHECK:const_addend_array3:
192 ; CHECK: .long bytes + 9 192 ; CHECK: .long bytes + 9
193 ; CHECK: .size const_addend_array3, 4 193 ; CHECK: .size const_addend_array3, 4
194 194
195 @addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @c ompound to i32), i32 1) 195 @addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @c ompound to i32), i32 1)
196 ; DUMP: @addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i3 2 }>* @compound to i32), i32 1) 196 ; DUMP: @addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i3 2 }>* @compound to i32), i32 1)
197 ; CHECK:» .type» addend_struct1,@object 197 ; CHECK:» .type» addend_struct1,%object
198 ; CHECK:» .section» .data,"aw",@progbits 198 ; CHECK:» .section» .data,"aw",%progbits
199 ; CHECK:addend_struct1: 199 ; CHECK:addend_struct1:
200 ; CHECK: .long compound + 1 200 ; CHECK: .long compound + 1
201 ; CHECK: .size addend_struct1, 4 201 ; CHECK: .size addend_struct1, 4
202 202
203 @const_addend_struct1 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i3 2 }>* @compound to i32), i32 1) 203 @const_addend_struct1 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i3 2 }>* @compound to i32), i32 1)
204 ; DUMP: @const_addend_struct1 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1) 204 ; DUMP: @const_addend_struct1 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1)
205 ; CHECK:» .type» const_addend_struct1,@object 205 ; CHECK:» .type» const_addend_struct1,%object
206 ; CHECK:» .section» .rodata,"a",@progbits 206 ; CHECK:» .section» .rodata,"a",%progbits
207 ; CHECK:const_addend_struct1: 207 ; CHECK:const_addend_struct1:
208 ; CHECK: .long compound + 1 208 ; CHECK: .long compound + 1
209 ; CHECK: .size const_addend_struct1, 4 209 ; CHECK: .size const_addend_struct1, 4
210 210
211 @addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @c ompound to i32), i32 4) 211 @addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @c ompound to i32), i32 4)
212 ; DUMP: @addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i3 2 }>* @compound to i32), i32 4) 212 ; DUMP: @addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i3 2 }>* @compound to i32), i32 4)
213 ; CHECK:» .type» addend_struct2,@object 213 ; CHECK:» .type» addend_struct2,%object
214 ; CHECK:» .section» .data,"aw",@progbits 214 ; CHECK:» .section» .data,"aw",%progbits
215 ; CHECK:addend_struct2: 215 ; CHECK:addend_struct2:
216 ; CHECK: .long compound + 4 216 ; CHECK: .long compound + 4
217 ; CHECK: .size addend_struct2, 4 217 ; CHECK: .size addend_struct2, 4
218 218
219 @const_addend_struct2 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i3 2 }>* @compound to i32), i32 4) 219 @const_addend_struct2 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i3 2 }>* @compound to i32), i32 4)
220 ; DUMP: @const_addend_struct2 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4) 220 ; DUMP: @const_addend_struct2 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4)
221 ; CHECK:» .type» const_addend_struct2,@object 221 ; CHECK:» .type» const_addend_struct2,%object
222 ; CHECK:» .section» .rodata,"a",@progbits 222 ; CHECK:» .section» .rodata,"a",%progbits
223 ; CHECK:const_addend_struct2: 223 ; CHECK:const_addend_struct2:
224 ; CHECK: .long compound + 4 224 ; CHECK: .long compound + 4
225 ; CHECK: .size const_addend_struct2, 4 225 ; CHECK: .size const_addend_struct2, 4
226 226
227 @ptr_to_func_align = internal global i32 ptrtoint (void ()* @func to i32), align 8 227 @ptr_to_func_align = internal global i32 ptrtoint (void ()* @func to i32), align 8
228 ; DUMP: @ptr_to_func_align = internal global i32 ptrtoint (void ()* @func to i32 ), align 8 228 ; DUMP: @ptr_to_func_align = internal global i32 ptrtoint (void ()* @func to i32 ), align 8
229 ; CHECK:» .type» ptr_to_func_align,@object 229 ; CHECK:» .type» ptr_to_func_align,%object
230 ; CHECK:» .section» .data,"aw",@progbits 230 ; CHECK:» .section» .data,"aw",%progbits
231 ; CHECK:» .align» 8 231 ; CHECK:» .p2align» 3
232 ; CHECK:ptr_to_func_align: 232 ; CHECK:ptr_to_func_align:
233 ; CHECK: .long func 233 ; CHECK: .long func
234 ; CHECK: .size ptr_to_func_align, 4 234 ; CHECK: .size ptr_to_func_align, 4
235 235
236 @const_ptr_to_func_align = internal constant i32 ptrtoint (void ()* @func to i32 ), align 8 236 @const_ptr_to_func_align = internal constant i32 ptrtoint (void ()* @func to i32 ), align 8
237 ; DUMP: @const_ptr_to_func_align = internal constant i32 ptrtoint (void ()* @fun c to i32), align 8 237 ; DUMP: @const_ptr_to_func_align = internal constant i32 ptrtoint (void ()* @fun c to i32), align 8
238 ; CHECK:» .type» const_ptr_to_func_align,@object 238 ; CHECK:» .type» const_ptr_to_func_align,%object
239 ; CHECK:» .section» .rodata,"a",@progbits 239 ; CHECK:» .section» .rodata,"a",%progbits
240 ; CHECK:» .align» 8 240 ; CHECK:» .p2align» 3
241 ; CHECK:const_ptr_to_func_align: 241 ; CHECK:const_ptr_to_func_align:
242 ; CHECK: .long func 242 ; CHECK: .long func
243 ; CHECK: .size const_ptr_to_func_align, 4 243 ; CHECK: .size const_ptr_to_func_align, 4
244 244
245 @char = internal constant [1 x i8] c"0" 245 @char = internal constant [1 x i8] c"0"
246 ; DUMP: @char = internal constant [1 x i8] c"0" 246 ; DUMP: @char = internal constant [1 x i8] c"0"
247 ; CHECK:» .type» char,@object 247 ; CHECK:» .type» char,%object
248 ; CHECK:» .section» .rodata,"a",@progbits 248 ; CHECK:» .section» .rodata,"a",%progbits
249 ; CHECK:char: 249 ; CHECK:char:
250 ; CHECK: .byte 48 250 ; CHECK: .byte 48
251 ; CHECK: .size char, 1 251 ; CHECK: .size char, 1
252 252
253 @short = internal constant [2 x i8] zeroinitializer 253 @short = internal constant [2 x i8] zeroinitializer
254 ; DUMP: @short = internal constant [2 x i8] zeroinitializer 254 ; DUMP: @short = internal constant [2 x i8] zeroinitializer
255 ; CHECK:» .type» short,@object 255 ; CHECK:» .type» short,%object
256 ; CHECK:» .section» .rodata,"a",@progbits 256 ; CHECK:» .section» .rodata,"a",%progbits
257 ; CHECK:short: 257 ; CHECK:short:
258 ; CHECK: .zero 2 258 ; CHECK: .zero 2
259 ; CHECK: .size short, 2 259 ; CHECK: .size short, 2
260 260
261 define void @func() { 261 define void @func() {
262 ret void 262 ret void
263 } 263 }
264 264
265 ; DUMP: define void @func() { 265 ; DUMP: define void @func() {
266 266
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/globalinit.pnacl.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698