diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-09 00:37:14 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-09 00:37:14 +0000 |
commit | 3f86ce1dc64a46d9cd3675787b8af32c9158abe6 (patch) | |
tree | c39ceaa693d4262d65512937d4eb43e5ce86e174 /test/CodeGenCXX/reference-cast.cpp | |
parent | 6b167f4fc40477847687c004b73166f53eeda8da (diff) |
Hand materialization of temporary expressions when emitting a scalar
expression. Fxies PR10592.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137086 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/reference-cast.cpp')
-rw-r--r-- | test/CodeGenCXX/reference-cast.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenCXX/reference-cast.cpp b/test/CodeGenCXX/reference-cast.cpp index 585d1dbd40..549434e941 100644 --- a/test/CodeGenCXX/reference-cast.cpp +++ b/test/CodeGenCXX/reference-cast.cpp @@ -168,3 +168,16 @@ 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); +} |