Daniel Dunbar | 1af336e | 2009-04-22 17:43:55 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -triple x86_64-apple-darwin9 -emit-llvm -o %t %s && |
| 2 | // RUNX: llvm-gcc -m64 -emit-llvm -S -o %t %s && |
| 3 | |
| 4 | // RUN: grep '@"OBJC_IVAR_$_I3._iv2" = global i64 8, section "__DATA, __objc_const", align 8' %t && |
| 5 | // RUN: grep '@"OBJC_IVAR_$_I3._iv3" = global i64 12, section "__DATA, __objc_const", align 8' %t && |
| 6 | // RUN: grep '@"OBJC_IVAR_$_I4._iv4" = global i64 16, section "__DATA, __objc_const", align 8' %t && |
| 7 | // RUN: grep '@"OBJC_IVAR_$_I5._iv5" = global i64 24, section "__DATA, __objc_const", align 8' %t && |
| 8 | // RUN: grep '@"OBJC_IVAR_$_I5._iv6_synth" = global i64 28, section "__DATA, __objc_const", align 8' %t && |
| 9 | // RUN: grep '@"OBJC_IVAR_$_I5._iv7_synth" = global i64 32, section "__DATA, __objc_const", align 8' %t && |
| 10 | |
| 11 | // RUN: true |
| 12 | |
| 13 | struct s0 { |
| 14 | double x; |
| 15 | }; |
| 16 | |
| 17 | @interface I2 { |
| 18 | struct s0 _iv1; |
| 19 | } |
| 20 | @end |
| 21 | |
| 22 | @interface I3 : I2 { |
| 23 | unsigned int _iv2 :1; |
| 24 | unsigned : 0; |
| 25 | unsigned int _iv3 : 3; |
| 26 | } |
| 27 | @end |
| 28 | |
| 29 | @interface I4 : I3 { |
| 30 | char _iv4; |
| 31 | } |
| 32 | @end |
| 33 | |
| 34 | @interface I5 : I4 { |
| 35 | char _iv5; |
| 36 | } |
| 37 | |
| 38 | @property int prop0; |
| 39 | @end |
| 40 | |
| 41 | @implementation I3 |
| 42 | @end |
| 43 | |
| 44 | @implementation I4 |
| 45 | @end |
| 46 | |
| 47 | @interface I5 () |
| 48 | @property int prop1; |
| 49 | @property char prop2; |
| 50 | @end |
| 51 | |
| 52 | @implementation I5 |
| 53 | @synthesize prop0 = _iv6_synth; |
| 54 | @synthesize prop1 = _iv7_synth; |
| 55 | @synthesize prop2 = _iv5; |
| 56 | @end |