Mercurial > hg > CbC > CbC_llvm
comparison clang/test/CodeGen/exprs.c @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
119 void f10() { | 119 void f10() { |
120 __builtin_sin(0); | 120 __builtin_sin(0); |
121 } | 121 } |
122 | 122 |
123 // rdar://7530813 | 123 // rdar://7530813 |
124 // CHECK-LABEL: define i32 @f11 | 124 // CHECK-LABEL: define{{.*}} i32 @f11 |
125 int f11(long X) { | 125 int f11(long X) { |
126 int A[100]; | 126 int A[100]; |
127 return A[X]; | 127 return A[X]; |
128 | 128 |
129 // CHECK: [[Xaddr:%[^ ]+]] = alloca i64, align 8 | 129 // CHECK: [[Xaddr:%[^ ]+]] = alloca i64, align 8 |
133 // CHECK-NEXT: load i32, i32* [[T0]], align 4 | 133 // CHECK-NEXT: load i32, i32* [[T0]], align 4 |
134 } | 134 } |
135 | 135 |
136 int f12() { | 136 int f12() { |
137 // PR3150 | 137 // PR3150 |
138 // CHECK-LABEL: define i32 @f12 | 138 // CHECK-LABEL: define{{.*}} i32 @f12 |
139 // CHECK: ret i32 1 | 139 // CHECK: ret i32 1 |
140 return 1||1; | 140 return 1||1; |
141 } | 141 } |
142 | 142 |
143 // Make sure negate of fp uses -0.0 for proper -0 handling. | 143 // Make sure negate of fp uses -0.0 for proper -0 handling. |
144 double f13(double X) { | 144 double f13(double X) { |
145 // CHECK-LABEL: define double @f13 | 145 // CHECK-LABEL: define{{.*}} double @f13 |
146 // CHECK: fneg double | 146 // CHECK: fneg double |
147 return -X; | 147 return -X; |
148 } | 148 } |
149 | 149 |
150 // Check operations on incomplete types. | 150 // Check operations on incomplete types. |
151 void f14(struct s14 *a) { | 151 void f14(struct s14 *a) { |
152 (void) &*a; | 152 (void) &*a; |
153 } | 153 } |
154 | 154 |
155 // CHECK-LABEL: define void @f15 | 155 // CHECK-LABEL: define{{.*}} void @f15 |
156 void f15() { | 156 void f15() { |
157 extern void f15_start(void); | 157 extern void f15_start(void); |
158 f15_start(); | 158 f15_start(); |
159 // CHECK: call void @f15_start() | 159 // CHECK: call void @f15_start() |
160 | 160 |
167 // CHECK-NOT: load | 167 // CHECK-NOT: load |
168 // CHECK: ret void | 168 // CHECK: ret void |
169 } | 169 } |
170 | 170 |
171 // PR8967: this was crashing | 171 // PR8967: this was crashing |
172 // CHECK-LABEL: define void @f16() | 172 // CHECK-LABEL: define{{.*}} void @f16() |
173 void f16() { | 173 void f16() { |
174 __extension__({ goto lbl; }); | 174 __extension__({ goto lbl; }); |
175 lbl: | 175 lbl: |
176 ; | 176 ; |
177 } | 177 } |
178 | 178 |
179 // PR13704: negative increment in i128 is not preserved. | 179 // PR13704: negative increment in i128 is not preserved. |
180 // CHECK-LABEL: define void @f17() | 180 // CHECK-LABEL: define{{.*}} void @f17() |
181 void f17() { | 181 void f17() { |
182 extern void extfunc(__int128); | 182 extern void extfunc(__int128); |
183 __int128 x = 2; | 183 __int128 x = 2; |
184 x--; | 184 x--; |
185 extfunc(x); | 185 extfunc(x); |
192 } strct; | 192 } strct; |
193 int returns_int(void); | 193 int returns_int(void); |
194 void f18() { | 194 void f18() { |
195 (strct)returns_int(); | 195 (strct)returns_int(); |
196 } | 196 } |
197 // CHECK-LABEL: define void @f18() | 197 // CHECK-LABEL: define{{.*}} void @f18() |
198 // CHECK: call i32 @returns_int() | 198 // CHECK: call i32 @returns_int() |
199 | 199 |
200 // Ensure the right stmt is returned | 200 // Ensure the right stmt is returned |
201 int f19() { | 201 int f19() { |
202 return ({ 3;;4;; }); | 202 return ({ 3;;4;; }); |
203 } | 203 } |
204 // CHECK-LABEL: define i32 @f19() | 204 // CHECK-LABEL: define{{.*}} i32 @f19() |
205 // CHECK: [[T:%.*]] = alloca i32 | 205 // CHECK: [[T:%.*]] = alloca i32 |
206 // CHECK: store i32 4, i32* [[T]] | 206 // CHECK: store i32 4, i32* [[T]] |
207 // CHECK: [[L:%.*]] = load i32, i32* [[T]] | 207 // CHECK: [[L:%.*]] = load i32, i32* [[T]] |
208 // CHECK: ret i32 [[L]] | 208 // CHECK: ret i32 [[L]] |