summaryrefslogtreecommitdiffstats
path: root/llvm/test/FrontendObjC
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-04-27 19:15:09 +0000
committerDale Johannesen <dalej@apple.com>2009-04-27 19:15:09 +0000
commit95743b2efd690b9b46f66d9714c8547cad888c16 (patch)
treea81b42ed23ceaed44ce0fa4bee098f13a11f01cd /llvm/test/FrontendObjC
parente6633567e02dbea3d7f5b41597e3a01d64f98ace (diff)
downloadbcm5719-llvm-95743b2efd690b9b46f66d9714c8547cad888c16.tar.gz
bcm5719-llvm-95743b2efd690b9b46f66d9714c8547cad888c16.zip
Test for (llvm-gcc) 70231.
llvm-svn: 70233
Diffstat (limited to 'llvm/test/FrontendObjC')
-rw-r--r--llvm/test/FrontendObjC/2009-04-27-bitfield-vs-ivar.m44
1 files changed, 44 insertions, 0 deletions
diff --git a/llvm/test/FrontendObjC/2009-04-27-bitfield-vs-ivar.m b/llvm/test/FrontendObjC/2009-04-27-bitfield-vs-ivar.m
new file mode 100644
index 00000000000..f5a4309d4cf
--- /dev/null
+++ b/llvm/test/FrontendObjC/2009-04-27-bitfield-vs-ivar.m
@@ -0,0 +1,44 @@
+// RUN: %llvmgcc -S -x objective-c -m64 -fobjc-abi-version=2 %s -o %t
+// RUN: grep {OBJC_CLASS_RO_\\\$_I4} %t | grep {i32 0, i32 1, i32 2, i32 0}
+// RUN: grep {OBJC_CLASS_RO_\\\$_I2} %t | grep {i32 0, i32 1, i32 1, i32 0}
+// RUN: grep {OBJC_CLASS_RO_\\\$_I5} %t | grep {i32 0, i32 0, i32 0, i32 0}
+// XTARGETS: darwin
+
+// Test instance variable sizing when base class ends in bitfield
+@interface I3 {
+ unsigned int _iv2 :1;
+}
+@end
+
+@interface I4 : I3 {
+ char _iv4;
+}
+@end
+
+// Test case with no instance variables in derived class
+@interface I1 {
+ unsigned int _iv2 :1;
+}
+@end
+
+@interface I2 : I1 {
+}
+@end
+
+// Test case with no instance variables anywhere
+@interface I6 {
+}
+@end
+
+@interface I5 : I6 {
+}
+@end
+
+@implementation I4
+@end
+
+@implementation I2
+@end
+
+@implementation I5
+@end
OpenPOWER on IntegriCloud