Files
llvm-project/clang/test/CodeGenObjC/protocols-lazy.m
John McCall 9b0a7cea0f Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.

llvm-svn: 140957
2011-10-02 01:16:38 +00:00

48 lines
1.6 KiB
Objective-C

// RUN: %clang_cc1 -emit-llvm -triple i686-apple-darwin8 -fobjc-fragile-abi -o %t %s
// RUNX: llvm-gcc -S -emit-llvm -o %t %s &&
// No object generated
// RUN: grep OBJC_PROTOCOL_P0 %t | count 0
@protocol P0;
// No object generated
// RUN: grep OBJC_PROTOCOL_P1 %t | count 0
@protocol P1 -im1; @end
// Definition triggered by protocol reference.
// RUN: grep OBJC_PROTOCOL_P2 %t | count 3
// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P2 %t | count 3
@protocol P2 -im1; @end
void f0() { id x = @protocol(P2); }
// Forward definition triggered by protocol reference.
// RUN: grep OBJC_PROTOCOL_P3 %t | count 3
// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P3 %t | count 0
@protocol P3;
void f1() { id x = @protocol(P3); }
// Definition triggered by class reference.
// RUN: grep OBJC_PROTOCOL_P4 %t | count 3
// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P4 %t | count 3
@protocol P4 -im1; @end
@interface I0<P4> @end
@implementation I0 -im1 { return 0; }; @end
// Definition following forward reference.
// RUN: grep OBJC_PROTOCOL_P5 %t | count 3
// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P5 %t | count 3
@protocol P5;
void f2() { id x = @protocol(P5); } // This generates a forward
// reference, which has to be
// updated on the next line.
@protocol P5 -im1; @end
// Protocol reference following definition.
// RUN: grep OBJC_PROTOCOL_P6 %t | count 4
// RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P6 %t | count 3
@protocol P6 -im1; @end
@interface I1<P6> @end
@implementation I1 -im1 { return 0; }; @end
void f3() { id x = @protocol(P6); }