diff options
| author | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2008-02-07 19:29:53 +0000 |
|---|---|---|
| committer | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2008-02-07 19:29:53 +0000 |
| commit | 9eff02d9f814072ee11bf916e275c4912ec7d7d5 (patch) | |
| tree | 9a859eb96dd68029c79e62fdcf8e8bf98a5056bd /clang/test/CodeGen/bitfield.c | |
| parent | 16d4bc3dc0bb78e57ea23e80457836f58abde34d (diff) | |
| download | bcm5719-llvm-9eff02d9f814072ee11bf916e275c4912ec7d7d5.tar.gz bcm5719-llvm-9eff02d9f814072ee11bf916e275c4912ec7d7d5.zip | |
Simplify bitfield codegen.
Fix codegen of struct { short a[3]; int b:15; }.
llvm-svn: 46859
Diffstat (limited to 'clang/test/CodeGen/bitfield.c')
| -rw-r--r-- | clang/test/CodeGen/bitfield.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/bitfield.c b/clang/test/CodeGen/bitfield.c index 70414a9c1e3..740c41c5369 100644 --- a/clang/test/CodeGen/bitfield.c +++ b/clang/test/CodeGen/bitfield.c @@ -5,10 +5,12 @@ // RUN: grep "lshr i16 %tmp5, 9" %t1 // RUN: grep "and i32 %tmp, -8192" %t1 // RUN: grep "and i16 %tmp5, -32513" %t1 +// RUN: grep "getelementptr (i32\* bitcast (.struct.STestB2\* @stb2 to i32\*), i32 1)" %t1 // Test bitfield access struct STestB1 { int a:13; char b; unsigned short c:7;} stb1; +struct STestB2 { short a[3]; int b:15} stb2; int f() { return stb1.a + stb1.b + stb1.c; @@ -19,3 +21,12 @@ void g() { stb1.b = 10; stb1.c = 15; } + +int h() { + return stb2.a[1] + stb2.b; +} + +void i(){ + stb2.a[2] = -40; + stb2.b = 10; +} |

