summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/2006-05-19-SingleEltReturn.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/2006-05-19-SingleEltReturn.c')
-rw-r--r--clang/test/CodeGen/2006-05-19-SingleEltReturn.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CodeGen/2006-05-19-SingleEltReturn.c b/clang/test/CodeGen/2006-05-19-SingleEltReturn.c
new file mode 100644
index 0000000..819237c
--- /dev/null
+++ b/clang/test/CodeGen/2006-05-19-SingleEltReturn.c
@@ -0,0 +1,23 @@
+// Test returning a single element aggregate value containing a double.
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+struct X {
+ double D;
+};
+
+struct Y {
+ struct X x;
+};
+
+struct Y bar();
+
+void foo(struct Y *P) {
+ *P = bar();
+}
+
+struct Y bar() {
+ struct Y a;
+ a.x.D = 0;
+ return a;
+}
+