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

Side by Side Diff: tests_lit/llvm2ice_tests/reorder-global-variables.ll

Issue 1206723003: Function Layout, Global Variable Layout and Pooled Constants Layout Reordering (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
OLDNEW
(Empty)
1 ; Test of global variable reordering.
2
3 ; REQUIRES: allow_dump
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 \
8 ; RUN: --check-prefix=X8632ASM
9
10 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --target x8632 \
11 ; RUN: -i %s --disassemble --dis-flags=-rD \
12 ; RUN: --args -sz-seed=1 -O2 -reorder-global-variables \
13 ; RUN: | %if --need=target_X8632 --command FileCheck %s \
14 ; RUN: --check-prefix=X8632OBJ
15
16 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \
17 ; RUN: -i %s --args -sz-seed=1 -O2 -reorder-global-variables \
18 ; RUN: --skip-unimplemented \
19 ; RUN: | %if --need=target_ARM32 --command FileCheck %s \
20 ; RUN: --check-prefix=ARM32ASM
21
22 ; IAS is not implemented yet.
23 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \
24 ; RUN: -i %s --assemble --disassemble --dis-flags=-rD \
25 ; RUN: --args -sz-seed=1 -O2 -reorder-global-variables \
26 ; RUN: --skip-unimplemented \
27 ; RUN: | %if --need=target_ARM32 --command FileCheck %s \
28 ; RUN: --check-prefix=ARM32OBJ
29
30 ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \
31 ; RUN: -i %s --args -sz-seed=1 -Om1 -reorder-global-variables \
32 ; RUN: | %if --need=target_X8632 --command FileCheck %s \
33 ; RUN: --check-prefix=X8632ASM
34
35 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --target x8632 \
36 ; RUN: -i %s --disassemble --dis-flags=-rD \
37 ; RUN: --args -Om1 -sz-seed=1 -reorder-global-variables \
38 ; RUN: | %if --need=target_X8632 --command FileCheck %s \
39 ; RUN: --check-prefix=X8632OBJ
40
41 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \
42 ; RUN: -i %s --args -sz-seed=1 -Om1 -reorder-global-variables \
43 ; RUN: --skip-unimplemented \
44 ; RUN: | %if --need=target_ARM32 --command FileCheck %s \
45 ; RUN: --check-prefix=ARM32ASM
46
47 ; IAS is not implemented yet.
48 ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \
49 ; RUN: -i %s --assemble --disassemble --dis-flags=-rD \
50 ; RUN: --args -sz-seed=1 -Om1 -reorder-global-variables \
51 ; RUN: --skip-unimplemented \
52 ; RUN: | %if --need=target_ARM32 --command FileCheck %s \
53 ; RUN: --check-prefix=ARM32OBJ
54
55
56 define internal i32 @main(i32 %argc, i32 %argv) {
Jim Stichnoth 2015/06/25 13:20:59 I think this test could be simplified by removing
qining 2015/06/25 21:10:10 Done.
57 entry:
58 %expanded1 = ptrtoint [4 x i8]* @PrimitiveInit to i32
59 call void @use(i32 %expanded1)
60 %expanded3 = ptrtoint [4 x i8]* @PrimitiveInitConst to i32
61 call void @use(i32 %expanded3)
62 %expanded5 = ptrtoint [4 x i8]* @PrimitiveInitStatic to i32
63 call void @use(i32 %expanded5)
64 %expanded7 = ptrtoint [4 x i8]* @PrimitiveUninit to i32
65 call void @use(i32 %expanded7)
66 %expanded9 = ptrtoint [20 x i8]* @ArrayInit to i32
67 call void @use(i32 %expanded9)
68 %expanded11 = ptrtoint [40 x i8]* @ArrayInitPartial to i32
69 call void @use(i32 %expanded11)
70 %expanded13 = ptrtoint [20 x i8]* @ArrayUninit to i32
71 call void @use(i32 %expanded13)
72 ret i32 0
73 }
74 declare void @use(i32)
75
76 define internal i32 @nacl_tp_tdb_offset(i32 %__0) {
77 entry:
78 ret i32 0
79 }
80
81 define internal i32 @nacl_tp_tls_offset(i32 %size) {
82 entry:
83 %result = sub i32 0, %size
84 ret i32 %result
85 }
86
87
88 @PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4
89
90 @PrimitiveInitConst = internal constant [4 x i8] c"\0D\00\00\00", align 4
91
92 @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
93
94 @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
95
96 @PrimitiveInitStatic = internal global [4 x i8] zeroinitializer, align 4
97
98 @PrimitiveUninit = internal global [4 x i8] zeroinitializer, align 4
99
100 @ArrayUninit = internal global [20 x i8] zeroinitializer, align 4
101
102 @ArrayUninitConstDouble = internal constant [200 x i8] zeroinitializer, align 8
103
104 @ArrayUninitConstInt = internal constant [20 x i8] zeroinitializer, align 4
105
106 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
107 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
108 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8
109 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4
110
111 ; Make sure the shuffled order is correct.
112
113 ; X8632ASM-LABEL: PrimitiveUninit
114 ; X8632ASM-LABEL: __init_array_start
115 ; X8632ASM-LABEL: ArrayUninitConstDouble
116 ; X8632ASM-LABEL: __tls_template_alignment
117 ; X8632ASM-LABEL: ArrayInitPartial
118 ; X8632ASM-LABEL: ArrayUninit
119 ; X8632ASM-LABEL: ArrayInit
120 ; X8632ASM-LABEL: __fini_array_start
121 ; X8632ASM-LABEL: PrimitiveInitStatic
122 ; X8632ASM-LABEL: ArrayUninitConstInt
123 ; X8632ASM-LABEL: PrimitiveInit
124 ; X8632ASM-LABEL: PrimitiveInitConst
125 ; X8632ASM-LABEL: __tls_template_start
126
127 ; X8632OBJ-LABEL: ArrayInitPartial
128 ; X8632OBJ-LABEL: ArrayInit
129 ; X8632OBJ-LABEL: PrimitiveInit
130 ; X8632OBJ-LABEL: PrimitiveUninit
131 ; X8632OBJ-LABEL: ArrayUninit
132 ; X8632OBJ-LABEL: PrimitiveInitStatic
133 ; X8632OBJ-LABEL: ArrayUninitConstDouble
134 ; X8632OBJ-LABEL: __tls_template_alignment
135 ; X8632OBJ-LABEL: ArrayUninitConstInt
136 ; X8632OBJ-LABEL: PrimitiveInitConst
137
138 ; ARM32ASM-LABEL: PrimitiveUninit
139 ; ARM32ASM-LABEL: __init_array_start
140 ; ARM32ASM-LABEL: ArrayUninitConstDouble
141 ; ARM32ASM-LABEL: __tls_template_alignment
142 ; ARM32ASM-LABEL: ArrayInitPartial
143 ; ARM32ASM-LABEL: ArrayUninit
144 ; ARM32ASM-LABEL: ArrayInit
145 ; ARM32ASM-LABEL: __fini_array_start
146 ; ARM32ASM-LABEL: PrimitiveInitStatic
147 ; ARM32ASM-LABEL: ArrayUninitConstInt
148 ; ARM32ASM-LABEL: PrimitiveInit
149 ; ARM32ASM-LABEL: PrimitiveInitConst
150 ; ARM32ASM-LABEL: __tls_template_start
151
152 ; ARM32OBJ-LABEL: ArrayInitPartial
153 ; ARM32OBJ-LABEL: ArrayInit
154 ; ARM32OBJ-LABEL: PrimitiveInit
155 ; ARM32OBJ-LABEL: PrimitiveUninit
156 ; ARM32OBJ-LABEL: ArrayUninit
157 ; ARM32OBJ-LABEL: PrimitiveInitStatic
158 ; ARM32OBJ-LABEL: ArrayUninitConstDouble
159 ; ARM32OBJ-LABEL: __tls_template_alignment
160 ; ARM32OBJ-LABEL: ArrayUninitConstInt
161 ; ARM32OBJ-LABEL: PrimitiveInitConst
162
Jim Stichnoth 2015/06/25 13:20:59 trailing blank line
qining 2015/06/25 21:10:10 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698