diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-09-04 03:20:13 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-04 03:20:13 +0000 |
commit | 80e62c29fe21cd06c93eba6e72b7e32dca06fcf9 (patch) | |
tree | 6728033352a9c86e77b0c5dfeb037e4b374f2cc5 /test/CodeGen/struct.c | |
parent | 3b6eede6b1d8ceac67cf58e5f0db1beaae904709 (diff) |
Implement codegen of aggregates as lvalues in binary expressions,
e.g. "(a = b).somefield".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/struct.c')
-rw-r--r-- | test/CodeGen/struct.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test/CodeGen/struct.c b/test/CodeGen/struct.c index 9af684b114..76d9b77274 100644 --- a/test/CodeGen/struct.c +++ b/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; +} |