summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/bitfield-2.c
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-04-22 15:22:33 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-04-22 15:22:33 +0000
commit5981377698591b640c9abf1e79cc11a803c43fe3 (patch)
tree38f35768b7aada5a21886fd768be90ab99269612 /clang/test/CodeGen/bitfield-2.c
parent5d6c07e0e9f38b63484f9ae4cc47cc0414e78339 (diff)
downloadbcm5719-llvm-5981377698591b640c9abf1e79cc11a803c43fe3.tar.gz
bcm5719-llvm-5981377698591b640c9abf1e79cc11a803c43fe3.zip
IRgen: Fix another case where we generated an invalid access component when we
immediately narrowed the access size. Fix this (and previous case) by just choosing a better access size up-front. llvm-svn: 102068
Diffstat (limited to 'clang/test/CodeGen/bitfield-2.c')
-rw-r--r--clang/test/CodeGen/bitfield-2.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGen/bitfield-2.c b/clang/test/CodeGen/bitfield-2.c
index 121bd7cd4fd..e91859fb728 100644
--- a/clang/test/CodeGen/bitfield-2.c
+++ b/clang/test/CodeGen/bitfield-2.c
@@ -345,3 +345,24 @@ unsigned test_8() {
res ^= g8.f0 ^ g8.f2 ^ g8.f3;
return res;
}
+
+/***/
+
+// This is another case where we narrow the access width immediately.
+//
+// <rdar://problem/7893760>
+
+struct __attribute__((packed)) s9 {
+ unsigned f0 : 7;
+ unsigned f1 : 7;
+ unsigned f2 : 7;
+ unsigned f3 : 7;
+ unsigned f4 : 7;
+ unsigned f5 : 7;
+ unsigned f6 : 7;
+ unsigned f7 : 7;
+};
+
+int f9_load(struct s9 *a0) {
+ return a0->f7;
+}
OpenPOWER on IntegriCloud