Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 1 | // REQUIRES: x86-registered-target |
John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S -o %t %s |
Fariborz Jahanian | 64089ce | 2011-04-22 22:02:28 +0000 | [diff] [blame] | 3 | // RUN: FileCheck < %t %s |
| 4 | |
| 5 | // rdar://9072317 |
| 6 | |
| 7 | /** The problem looks like clang getting confused when a single translation unit |
| 8 | contains a protocol with a property and two classes that implement that protocol |
| 9 | and synthesize the property. |
| 10 | */ |
| 11 | |
| 12 | @protocol Proto |
| 13 | @property (assign) id prop; |
| 14 | @end |
| 15 | |
| 16 | @interface NSObject @end |
| 17 | |
| 18 | @interface Foo : NSObject <Proto> { int x; } @end |
| 19 | |
| 20 | @interface Bar : NSObject <Proto> @end |
| 21 | |
| 22 | @implementation Foo |
| 23 | @synthesize prop; |
| 24 | @end |
| 25 | |
| 26 | @implementation Bar |
| 27 | @synthesize prop; |
| 28 | @end |
| 29 | |
| 30 | // CHECK: l_OBJC_$_INSTANCE_METHODS_Bar: |
Benjamin Kramer | d6d76f2 | 2012-08-17 12:28:21 +0000 | [diff] [blame] | 31 | // CHECK-NEXT: .long 24 |
| 32 | // CHECK-NEXT: .long 2 |
| 33 | // CHECK-NEXT: .quad L_OBJC_METH_VAR_NAME_ |
| 34 | // CHECK-NEXT: .quad L_OBJC_METH_VAR_TYPE_ |
| 35 | // CHECK-NEXT: .quad "-[Bar prop]" |