2017-02-18 03:36:19 +08:00
|
|
|
// RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -std=c++98 -o - | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -std=c++11 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s
|
2010-11-17 07:07:28 +08:00
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK: @i = {{(dso_local )?}}global [[INT:i[0-9]+]] 0
|
2010-11-17 07:07:28 +08:00
|
|
|
volatile int i, j, k;
|
|
|
|
volatile int ar[5];
|
|
|
|
volatile char c;
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK: @ci = {{(dso_local )?}}global [[CINT:.*]] zeroinitializer
|
2010-11-17 07:07:28 +08:00
|
|
|
volatile _Complex int ci;
|
|
|
|
volatile struct S {
|
|
|
|
#ifdef __cplusplus
|
|
|
|
void operator =(volatile struct S&o) volatile;
|
|
|
|
#endif
|
|
|
|
int i;
|
|
|
|
} a, b;
|
|
|
|
|
|
|
|
//void operator =(volatile struct S&o1, volatile struct S&o2) volatile;
|
|
|
|
int printf(const char *, ...);
|
|
|
|
|
|
|
|
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: define {{.*}}void @{{.*}}test
|
2010-11-17 07:07:28 +08:00
|
|
|
void test() {
|
|
|
|
|
|
|
|
asm("nop"); // CHECK: call void asm
|
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
// should not load in C++98
|
2010-11-17 07:07:28 +08:00
|
|
|
i;
|
2017-02-18 03:36:19 +08:00
|
|
|
// CHECK11-NEXT: load volatile [[INT]], [[INT]]* @i
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
(float)(ci);
|
2015-03-14 02:21:46 +08:00
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: sitofp [[INT]]
|
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
// These are not uses in C++98:
|
2010-11-17 07:07:28 +08:00
|
|
|
// [expr.static.cast]p6:
|
|
|
|
// The lvalue-to-rvalue . . . conversions are not applied to the expression.
|
|
|
|
(void)ci;
|
2017-02-18 03:36:19 +08:00
|
|
|
// CHECK11-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK11-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
|
2010-11-17 07:07:28 +08:00
|
|
|
(void)a;
|
|
|
|
|
|
|
|
(void)(ci=ci);
|
2015-03-14 02:21:46 +08:00
|
|
|
// CHECK-NEXT: [[R:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: [[I:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
(void)(i=j);
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: [[T:%.*]] = load volatile [[INT]], [[INT]]* @j
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[T]], [[INT]]* @i
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
ci+=ci;
|
2015-03-14 02:21:46 +08:00
|
|
|
// CHECK-NEXT: [[R1:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: [[I1:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
// CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
2010-11-17 07:07:28 +08:00
|
|
|
// Not sure why they're ordered this way.
|
|
|
|
// CHECK-NEXT: [[R:%.*]] = add [[INT]] [[R2]], [[R1]]
|
|
|
|
// CHECK-NEXT: [[I:%.*]] = add [[INT]] [[I2]], [[I1]]
|
2015-03-14 02:21:46 +08:00
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
2010-11-17 07:07:28 +08:00
|
|
|
|
2011-08-13 07:33:52 +08:00
|
|
|
// Note that C++ requires an extra load volatile over C from the LHS of the '+'.
|
2010-11-17 07:07:28 +08:00
|
|
|
(ci += ci) + ci;
|
2015-03-14 02:21:46 +08:00
|
|
|
// CHECK-NEXT: [[R1:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: [[I1:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
// CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: [[R:%.*]] = add [[INT]] [[R2]], [[R1]]
|
|
|
|
// CHECK-NEXT: [[I:%.*]] = add [[INT]] [[I2]], [[I1]]
|
2015-03-14 02:21:46 +08:00
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[R]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[I]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
// CHECK-NEXT: [[R1:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: [[I1:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
// CHECK-NEXT: [[R2:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0)
|
|
|
|
// CHECK-NEXT: [[I2:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
2010-11-17 07:07:28 +08:00
|
|
|
// These additions can be elided.
|
|
|
|
// CHECK-NEXT: add [[INT]] [[R1]], [[R2]]
|
|
|
|
// CHECK-NEXT: add [[INT]] [[I1]], [[I2]]
|
|
|
|
|
|
|
|
asm("nop"); // CHECK-NEXT: call void asm
|
|
|
|
|
2011-08-13 07:33:52 +08:00
|
|
|
// Extra load volatile in C++.
|
2010-11-17 07:07:28 +08:00
|
|
|
(i += j) + k;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add nsw [[INT]]
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add nsw [[INT]]
|
|
|
|
|
|
|
|
asm("nop"); // CHECK-NEXT: call void asm
|
|
|
|
|
2011-08-13 07:33:52 +08:00
|
|
|
// Extra load volatile in C++.
|
2010-11-17 07:07:28 +08:00
|
|
|
(i += j) + 1;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add nsw [[INT]]
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add nsw [[INT]]
|
|
|
|
|
|
|
|
asm("nop"); // CHECK-NEXT: call void asm
|
|
|
|
|
|
|
|
ci+ci;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add [[INT]]
|
|
|
|
// CHECK-NEXT: add [[INT]]
|
|
|
|
|
|
|
|
__real i;
|
|
|
|
|
|
|
|
+ci;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
asm("nop"); // CHECK-NEXT: call void asm
|
|
|
|
|
|
|
|
(void)(i=i);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
(float)(i=i);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: sitofp
|
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
(void)i; // This is now a load in C++11
|
|
|
|
// CHECK11-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
i=i;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
2011-08-13 07:33:52 +08:00
|
|
|
// Extra load volatile in C++.
|
2010-11-17 07:07:28 +08:00
|
|
|
i=i=i;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
(void)__builtin_choose_expr(0, i=i, j=j);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
k ? (i=i) : (j=j);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: icmp
|
|
|
|
// CHECK-NEXT: br i1
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: br label
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: br label
|
2011-01-26 12:00:11 +08:00
|
|
|
// CHECK: phi
|
2010-11-17 07:07:28 +08:00
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
(void)(i,(i=i)); // first i is also a load in C++11
|
|
|
|
// CHECK11-NEXT: load volatile
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
i=i,k; // k is also a load in C++11
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @i
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @i
|
2017-02-18 03:36:19 +08:00
|
|
|
// CHECK11-NEXT: load volatile [[INT]], [[INT]]* @k
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
(i=j,k=j);
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @j
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @i
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @j
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @k
|
2010-11-17 07:07:28 +08:00
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
(i=j,k); // k is also a load in C++11
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @j
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @i
|
2017-02-18 03:36:19 +08:00
|
|
|
// CHECK11-NEXT: load volatile [[INT]], [[INT]]* @k
|
2010-11-17 07:07:28 +08:00
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
(i,j); // i and j both are loads in C++11
|
|
|
|
// CHECK11-NEXT: load volatile [[INT]], [[INT]]* @i
|
|
|
|
// CHECK11-NEXT: load volatile [[INT]], [[INT]]* @j
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
// Extra load in C++.
|
|
|
|
i=c=k;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: trunc
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: sext
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
i+=k;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add nsw [[INT]]
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
ci; // ci is a load in C++11
|
|
|
|
// CHECK11-NEXT: load volatile {{.*}} @ci, i32 0, i32 0
|
|
|
|
// CHECK11-NEXT: load volatile {{.*}} @ci, i32 0, i32 1
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
asm("nop"); // CHECK-NEXT: call void asm
|
|
|
|
|
|
|
|
(int)ci;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile {{.*}} @ci, i32 0, i32 0
|
|
|
|
// CHECK-NEXT: load volatile {{.*}} @ci, i32 0, i32 1
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
(bool)ci;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile {{.*}} @ci, i32 0, i32 0
|
|
|
|
// CHECK-NEXT: load volatile {{.*}} @ci, i32 0, i32 1
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: icmp ne
|
|
|
|
// CHECK-NEXT: icmp ne
|
|
|
|
// CHECK-NEXT: or i1
|
|
|
|
|
|
|
|
ci=ci;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
asm("nop"); // CHECK-NEXT: call void asm
|
|
|
|
|
|
|
|
// Extra load in C++.
|
|
|
|
ci=ci=ci;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
__imag ci = __imag ci = __imag ci;
|
2015-03-14 02:21:46 +08:00
|
|
|
// CHECK-NEXT: [[T:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[T]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
// CHECK-NEXT: [[T:%.*]] = load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
|
|
|
// CHECK-NEXT: store volatile [[INT]] [[T]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 1)
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
__real (i = j);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
__imag i;
|
|
|
|
|
|
|
|
// ============================================================
|
|
|
|
// FIXME: Test cases we get wrong.
|
|
|
|
|
|
|
|
// A use. We load all of a into a copy of a, then load i. gcc forgets to do
|
|
|
|
// the assignment.
|
|
|
|
// (a = a).i;
|
|
|
|
|
|
|
|
// ============================================================
|
|
|
|
// Test cases where we intentionally differ from gcc, due to suspected bugs in
|
|
|
|
// gcc.
|
|
|
|
|
|
|
|
// Not a use. gcc forgets to do the assignment.
|
2013-12-13 00:07:11 +08:00
|
|
|
// CHECK-NEXT: call {{.*}}void
|
2010-11-17 07:07:28 +08:00
|
|
|
((a=a),a);
|
|
|
|
|
|
|
|
// Not a use. gcc gets this wrong, it doesn't emit the copy!
|
2013-12-13 00:07:11 +08:00
|
|
|
// CHECK-NEXT: call {{.*}}void
|
2010-11-17 07:07:28 +08:00
|
|
|
(void)(a=a);
|
|
|
|
|
|
|
|
// Not a use. gcc got this wrong in 4.2 and omitted the side effects
|
|
|
|
// entirely, but it is fixed in 4.4.0.
|
|
|
|
__imag (i = j);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
// C++ does an extra load here. Note that we have to do full loads.
|
|
|
|
(float)(ci=ci);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: sitofp
|
|
|
|
|
|
|
|
// Not a use, bug? gcc treats this as not a use, that's probably a
|
|
|
|
// bug due to tree folding ignoring volatile.
|
|
|
|
(int)(ci=ci);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
// A use.
|
|
|
|
(float)(i=i);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: sitofp
|
|
|
|
|
|
|
|
// A use. gcc treats this as not a use, that's probably a bug due to tree
|
|
|
|
// folding ignoring volatile.
|
|
|
|
(int)(i=i);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
// A use.
|
|
|
|
-(i=j);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: sub
|
|
|
|
|
|
|
|
// A use. gcc treats this a not a use, that's probably a bug due to tree
|
|
|
|
// folding ignoring volatile.
|
|
|
|
+(i=k);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
// A use. gcc treats this a not a use, that's probably a bug due to tree
|
|
|
|
// folding ignoring volatile.
|
|
|
|
__real (ci=ci);
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
// A use.
|
|
|
|
i + 0;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add
|
|
|
|
|
|
|
|
// A use.
|
|
|
|
(i=j) + i;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add
|
|
|
|
|
|
|
|
// A use. gcc treats this as not a use, that's probably a bug due to tree
|
|
|
|
// folding ignoring volatile.
|
|
|
|
(i=j) + 0;
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: load volatile
|
|
|
|
// CHECK-NEXT: store volatile
|
|
|
|
// CHECK-NEXT: load volatile
|
2010-11-17 07:07:28 +08:00
|
|
|
// CHECK-NEXT: add
|
|
|
|
|
2017-02-18 03:36:19 +08:00
|
|
|
(i,j)=k; // i is also a load in C++11
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @k
|
2017-02-18 03:36:19 +08:00
|
|
|
// CHECK11-NEXT: load volatile [[INT]], [[INT]]* @i
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @j
|
2010-11-17 07:07:28 +08:00
|
|
|
|
|
|
|
(j=k,i)=i;
|
2015-02-28 05:19:58 +08:00
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @i
|
|
|
|
// CHECK-NEXT: load volatile [[INT]], [[INT]]* @k
|
2011-08-13 07:33:52 +08:00
|
|
|
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @j
|
|
|
|
// CHECK-NEXT: store volatile {{.*}}, [[INT]]* @i
|
2010-12-05 10:00:02 +08:00
|
|
|
|
|
|
|
// CHECK-NEXT: ret void
|
2010-11-17 07:07:28 +08:00
|
|
|
}
|