summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/references.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-05-27 01:45:47 +0000
committerAnders Carlsson <andersca@mac.com>2009-05-27 01:45:47 +0000
commit482656833a71b63f67f3e93ee8c2d45b3d351ca8 (patch)
treec7051c44017ea662a88c01df1d79d669b69565df /test/CodeGenCXX/references.cpp
parentff4bf3bd6174f6a02da4ee2efc6064c005295d44 (diff)
Add support for emitting calls to functions that return references (as lvalues only for now)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/references.cpp')
-rw-r--r--test/CodeGenCXX/references.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/CodeGenCXX/references.cpp b/test/CodeGenCXX/references.cpp
index 0124f695b3..97fc15e035 100644
--- a/test/CodeGenCXX/references.cpp
+++ b/test/CodeGenCXX/references.cpp
@@ -24,13 +24,19 @@ void f(const int&);
void f(const _Complex int&);
void f(const C&);
-C structfunc();
+C aggregate_return();
+
+bool& bool_reference_return();
+int& int_reference_return();
+_Complex int& complex_int_reference_return();
void test_bool() {
bool a = true;
f(a);
f(true);
+
+ bool_reference_return() = true;
}
void test_scalar() {
@@ -44,6 +50,8 @@ void test_scalar() {
__attribute((vector_size(16))) typedef int vec4;
f((vec4){1,2,3,4}[0]);
+
+ int_reference_return() = 10;
}
void test_complex() {
@@ -51,12 +59,14 @@ void test_complex() {
f(a);
f(10i);
+
+ complex_int_reference_return() = 10i;
}
void test_aggregate() {
C c;
f(c);
- f(structfunc());
+ f(aggregate_return());
}