summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/struct.c
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-09-04 03:20:13 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-09-04 03:20:13 +0000
commit8cde00a510a3cf129f73c559589cf5e36de63007 (patch)
tree79e4d3a8b25e80c2a7185fdeea3f0cb373e6e3f6 /clang/test/CodeGen/struct.c
parent82aa5aba93774c340be3230954279eddf7c3ad93 (diff)
downloadbcm5719-llvm-8cde00a510a3cf129f73c559589cf5e36de63007.tar.gz
bcm5719-llvm-8cde00a510a3cf129f73c559589cf5e36de63007.zip
Implement codegen of aggregates as lvalues in binary expressions,
e.g. "(a = b).somefield". llvm-svn: 55758
Diffstat (limited to 'clang/test/CodeGen/struct.c')
-rw-r--r--clang/test/CodeGen/struct.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/clang/test/CodeGen/struct.c b/clang/test/CodeGen/struct.c
index 9af684b1140..76d9b772742 100644
--- a/clang/test/CodeGen/struct.c
+++ b/clang/test/CodeGen/struct.c
@@ -69,7 +69,6 @@ typedef struct {
int location;
int length;
} range;
-
extern range f6();
void f7()
{
@@ -166,3 +165,27 @@ struct __attribute__((packed)) S2839 { double a[19]; signed char b; } s2839[5];
struct __attribute__((packed)) SS { long double a; char b; } SS;
+
+/* As lvalue */
+
+int f15() {
+ extern range f15_ext();
+ return f15_ext().location;
+}
+
+range f16() {
+ extern rangepair f16_ext();
+ return f16_ext().range1;
+}
+
+int f17() {
+ extern range f17_ext();
+ range r;
+ return (r = f17_ext()).location;
+}
+
+range f18() {
+ extern rangepair f18_ext();
+ rangepair rp;
+ return (rp = f18_ext()).range1;
+}
OpenPOWER on IntegriCloud