brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 1dae6bf Raw
51 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions -Wno-objc-root-class %s2 3void test1(void) {4  void *xyzzy = 0;5  void *p = @xyzzy; // expected-error {{unexpected '@' in program}}6}7 8// This previously triggered a crash because the class has not been defined.9@implementation RDar7495713 (rdar_7495713_cat)  // expected-error{{cannot find interface declaration for 'RDar7495713'}}10- (id) rdar_7495713 {11  __PRETTY_FUNCTION__; // expected-warning{{expression result unused}}12}13@end14 15// This previously triggered a crash because a ';' was expected after the @throw statement.16void foo(void) {17  @throw (id)0 // expected-error{{expected ';' after @throw}}18}19 20@class NSView;21@implementation IBFillView(IBFillViewIntegration) // expected-error {{cannot find interface declaration for 'IBFillView'}}22- (NSView *)ibDesignableContentView {23    [Cake lie]; // expected-error {{undeclared}}24    return self;25}26@end27 28@interface I29@end30@interface I231@end32 33@implementation I // expected-note {{started here}}34-(void) foo {}35 36@implementation I2 // expected-error {{missing '@end'}}37-(void) foo2 {}38@end39 40@end // expected-error {{'@end' must appear in an Objective-C context}}41 42@class ForwardBase;43@implementation SomeI : ForwardBase // expected-error {{cannot find interface declaration for 'ForwardBase', superclass of 'SomeI'}} \44                                    // expected-warning {{cannot find interface declaration for 'SomeI'}}45-(void)meth {}46@end47 48@interface I349__attribute__((unavailable)) @interface I4 @end // expected-error {{Objective-C declarations may only appear in global scope}}50@end51