summaryrefslogtreecommitdiffstats
path: root/clang/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
commit4ae70ff9a34727fd6d749d01f569efd22a7176f8 (patch)
tree631f121d030678957411f7250474d164c7027fb5 /clang/test/CodeGenCXX/references.cpp
parent3e97f3b35db533ef81ea347630b0f9fdbd9384e8 (diff)
downloadbcm5719-llvm-4ae70ff9a34727fd6d749d01f569efd22a7176f8.tar.gz
bcm5719-llvm-4ae70ff9a34727fd6d749d01f569efd22a7176f8.zip
Add support for emitting calls to functions that return references (as lvalues only for now)
llvm-svn: 72449
Diffstat (limited to 'clang/test/CodeGenCXX/references.cpp')
-rw-r--r--clang/test/CodeGenCXX/references.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/references.cpp b/clang/test/CodeGenCXX/references.cpp
index 0124f695b3b..97fc15e0359 100644
--- a/clang/test/CodeGenCXX/references.cpp
+++ b/clang/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());
}
OpenPOWER on IntegriCloud