1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -std=c++98 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK98 %s
2 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -std=c++11 -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK11 %s
4 // Check that IR gen doesn't try to do an lvalue-to-rvalue conversion
5 // on a volatile reference result.
9 A
& operator=(const A
& t
);
10 volatile A
& operator=(const volatile A
& t
) volatile;
15 // CHECK-LABEL: define{{.*}} void @_ZN5test04testENS_1AE(
17 // CHECK: [[ARR:%.*]] = load ptr, ptr @_ZN5test05arrayE, align 8
18 // CHECK-NEXT: [[IDX:%.*]] = getelementptr inbounds [[A:%.*]], ptr [[ARR]], i64 0
19 // CHECK-NEXT: [[TMP:%.*]] = call noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_ZNV5test01AaSERVKS0_(ptr {{[^,]*}} [[IDX]], ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) [[T:%.*]])
20 // CHECK-NEXT: ret void
28 // CHECK-LABEL: define{{.*}} void @_ZN5test14testEv()
30 // CHECK: [[TMP:%.*]] = load ptr, ptr @_ZN5test11xE, align 8
31 // CHECK11-NEXT: {{%.*}} = load volatile i32, ptr [[TMP]], align 4
32 // CHECK-NEXT: ret void
38 template <class T
> struct S
{
39 // CHECK-LABEL: define {{.*}} @_ZN7PR406421SIiE3fooEv(
41 // CHECK98-NOT: load volatile
42 // CHECK11: load volatile
44 reinterpret_cast<const volatile unsigned char *>(m_ptr
)[0];
50 void f(S
<int> *x
) { x
->foo(); }