brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 5e5e78c Raw
56 lines · plain
1// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin8 -fobjc-runtime=macosx-fragile-10.5 -o %t %s2 3// No object generated4// RUN: not grep OBJC_PROTOCOL_P0 %t5@protocol P0;6 7// No object generated8// RUN: not grep OBJC_PROTOCOL_P1 %t9@protocol P1 -im1; @end10 11// Definition triggered by protocol reference.12// RUN: grep OBJC_PROTOCOL_P2 %t | count 313// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P2 %t | count 314@protocol P2 -im1; @end15void f0(void) { id x = @protocol(P2); }16 17// Forward definition triggered by protocol reference.18// RUN: grep OBJC_PROTOCOL_P3 %t | count 319// RUN: not grep OBJC_PROTOCOL_INSTANCE_METHODS_P3 %t20@protocol P3;21@interface UserP3<P3>22@end23@implementation UserP324@end25 26// Definition triggered by class reference.27// RUN: grep OBJC_PROTOCOL_P4 %t | count 328// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P4 %t | count 329@protocol P4 -im1; @end30@interface I0<P4> @end31@implementation I0 -im1 { return 0; }; @end32 33// Definition following forward reference.34// RUN: grep OBJC_PROTOCOL_P5 %t | count 335// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P5 %t | count 336@protocol P5;37@interface UserP5<P5> // This generates a forward38                      // reference, which has to be39                      // updated on the next line.40@end41@protocol P5 -im1; @end42@implementation UserP543 44- im1 { __builtin_unreachable(); }45 46@end47 48// Protocol reference following definition.49// RUN: grep OBJC_PROTOCOL_P6 %t | count 450// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P6 %t | count 351@protocol P6 -im1; @end52@interface I1<P6> @end53@implementation I1 -im1 { return 0; }; @end54void f3(void) { id x = @protocol(P6); }55 56