summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2008-01-22 20:17:04 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2008-01-22 20:17:04 +0000
commit2ddcb25a3bb411165ddeb8c9c345ef7617e27211 (patch)
treef2b9b50977877e4948728437a19d8283dfe6c034 /clang/test
parent97ff7763dca7b2717cc8e6fdf5d6cb7a0b28d62e (diff)
downloadbcm5719-llvm-2ddcb25a3bb411165ddeb8c9c345ef7617e27211.tar.gz
bcm5719-llvm-2ddcb25a3bb411165ddeb8c9c345ef7617e27211.zip
Implement bitfield read.
llvm-svn: 46257
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/bitfield.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/bitfield.c b/clang/test/CodeGen/bitfield.c
new file mode 100644
index 00000000000..51987655fd0
--- /dev/null
+++ b/clang/test/CodeGen/bitfield.c
@@ -0,0 +1,13 @@
+// RUN: clang %s -emit-llvm > %t1
+// RUN: grep "shl i32 %tmp, 19" %t1 &&
+// RUN: grep "ashr i32 %tmp1, 19" %t1 &&
+// RUN: grep "shl i16 %tmp4, 1" %t1 &&
+// RUN: grep "lshr i16 %tmp5, 9" %t1
+// Test bitfield access
+
+
+struct STestB1 { int a:13; char b; unsigned short c:7;} stb1;
+
+int f() {
+ return stb1.a + stb1.b + stb1.c;
+}
OpenPOWER on IntegriCloud