aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/reference-cast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/reference-cast.cpp')
-rw-r--r--test/CodeGenCXX/reference-cast.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGenCXX/reference-cast.cpp b/test/CodeGenCXX/reference-cast.cpp
index 585d1dbd4084..1d08b2b2e4b7 100644
--- a/test/CodeGenCXX/reference-cast.cpp
+++ b/test/CodeGenCXX/reference-cast.cpp
@@ -168,3 +168,27 @@ const _Complex float &f1() {
// CHECK: store float
return get_complex_double();
}
+
+// CHECK: define i32 @_Z7pr10592RKi(i32*
+unsigned pr10592(const int &v) {
+ // CHECK: [[VADDR:%[a-zA-Z0-9.]+]] = alloca i32*
+ // CHECK-NEXT: [[REFTMP:%[a-zA-Z0-9.]+]] = alloca i32
+ // CHECK-NEXT: store i32* [[V:%[a-zA-Z0-9.]+]], i32** [[VADDR]]
+ // CHECK-NEXT: [[VADDR_1:%[a-zA-Z0-9.]+]] = load i32** [[VADDR]]
+ // CHECK-NEXT: [[VVAL:%[a-zA-Z0-9.]+]] = load i32* [[VADDR_1]]
+ // CHECK-NEXT: store i32 [[VVAL]], i32* [[REFTMP]]
+ // CHECK-NEXT: [[VVAL_I:%[a-zA-Z0-9.]+]] = load i32* [[REFTMP]]
+ // CHECK-NEXT: ret i32 [[VVAL_I]]
+ return static_cast<const unsigned &>(v);
+}
+
+namespace PR10650 {
+ struct Helper {
+ unsigned long long id();
+ };
+ unsigned long long test(Helper *obj) {
+ return static_cast<const unsigned long long&>(obj->id());
+ }
+ // CHECK: define i64 @_ZN7PR106504testEPNS_6HelperE
+ // CHECK: store i64
+}