llvm-project
51 строка · 1.1 Кб
1// RUN: %clang_cc1 -emit-llvm -fobjc-runtime=gcc -o - %s | FileCheck %s
2
3@protocol NSCopying
4@end
5
6@interface NSObject {
7struct objc_object *isa;
8}
9+ (id) new;
10- (id) init;
11@end
12
13@interface NSString : NSObject <NSCopying>
14+ (NSString *)foo;
15@end
16
17@interface TestClass : NSObject {
18@public
19NSString *_stringIvar;
20int _intIvar;
21}
22@end
23@implementation TestClass
24
25@end
26
27int main(void) {
28TestClass *c = [TestClass new];
29return 0;
30}
31
32// CHECK: = private unnamed_addr constant [12 x i8] c"_stringIvar\00"
33// CHECK: = private unnamed_addr constant [12 x i8] c"@\22NSString\22\00"
34// CHECK: = private unnamed_addr constant [9 x i8] c"_intIvar\00"
35// CHECK: = private unnamed_addr constant [2 x i8] c"i\00"
36
37@interface Class1 {
38int : 3;
39short : 2;
40long long ll;
41char : 1;
42}
43@end
44
45@implementation Class1
46@end
47
48// CHECK: @{{.*}} = private unnamed_addr constant [5 x i8] c"b0i3\00"
49// CHECK: @{{.*}} = private unnamed_addr constant [5 x i8] c"b3s2\00"
50// CHECK: @{{.*}} = private unnamed_addr constant [2 x i8] c"q\00"
51// CHECK: @{{.*}} = private unnamed_addr constant [{{7|6}} x i8] c"b{{128|96}}c1\00"
52