aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/func-return-member.c
diff options
context:
space:
mode:
authorChristopher Lamb <christopher.lamb@gmail.com>2007-12-29 05:02:41 +0000
committerChristopher Lamb <christopher.lamb@gmail.com>2007-12-29 05:02:41 +0000
commit22c940ee588a420cd2e6c8f68be2ac3cc80061ff (patch)
tree2fcf5d7177cc2b4b46279f26d5d96210f3738aee /test/CodeGen/func-return-member.c
parentd3ba3f44ad3fc79f31ebbbe15a7a7f4a34226254 (diff)
Enable CodeGen for member expressions based on call expressions returning aggregate types. This enables expressions like 'foo().member.submember'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/func-return-member.c')
-rw-r--r--test/CodeGen/func-return-member.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGen/func-return-member.c b/test/CodeGen/func-return-member.c
new file mode 100644
index 0000000000..f31a53afce
--- /dev/null
+++ b/test/CodeGen/func-return-member.c
@@ -0,0 +1,23 @@
+// RUN: clang -emit-llvm < %s 2>&1 | not grep 'cannot codegen this l-value expression yet'
+
+struct frk { float _Complex c; int x; };
+struct faz { struct frk f; };
+struct fuz { struct faz f; };
+
+extern struct fuz foo(void);
+
+int X;
+struct frk F;
+float _Complex C;
+
+void bar(void) {
+ X = foo().f.f.x;
+}
+
+void bun(void) {
+ F = foo().f.f;
+}
+
+void ban(void) {
+ C = foo().f.f.c;
+}