brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 247e99e Raw
56 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -Wno-objc-duplicate-category-definition -DIGNORE_DUP_CAT %s3 4@interface Foo // expected-note {{previous definition is here}}5@end6 7float Foo;	// expected-error {{redefinition of 'Foo' as different kind of symbol}}8 9@class Bar;  // expected-note {{previous definition is here}}10 11typedef int Bar;  // expected-error {{redefinition of 'Bar' as different kind of symbol}}12 13@implementation FooBar // expected-warning {{cannot find interface declaration for 'FooBar'}} 14@end15 16 17typedef int OBJECT; // expected-note {{previous definition is here}}18 19@class OBJECT ;	// expected-error {{redefinition of 'OBJECT' as different kind of symbol}}20 21 22typedef int Gorf;  // expected-note {{previous definition is here}}23 24@interface Gorf @end // expected-error {{redefinition of 'Gorf' as different kind of symbol}} expected-note {{previous definition is here}}25 26void Gorf(void) // expected-error {{redefinition of 'Gorf' as different kind of symbol}}27{28  int Bar, Foo, FooBar;29}30 31@protocol P -im1; @end32@protocol Q -im2; @end33@interface A<P> @end  // expected-note {{previous definition is here}}34@interface A<Q> @end  // expected-error {{duplicate interface definition for class 'A'}}35 36@protocol PP<P> @end  // expected-note {{previous definition is here}}37@protocol PP<Q> @end  // expected-warning {{duplicate protocol definition of 'PP'}}38 39@protocol DP<P> @end40#pragma clang diagnostic push41#pragma clang diagnostic ignored "-Wduplicate-protocol"42@protocol DP<Q> @end43#pragma clang diagnostic pop44 45@interface A(Cat)<P> @end46@interface A(Cat)<Q> @end47 48#ifndef IGNORE_DUP_CAT49// expected-note@-4 {{previous definition is here}}50// expected-warning@-4 {{duplicate definition of category 'Cat' on interface 'A'}}51#endif52 53@class NSString;54NSString * TestBaz;  // expected-note {{previous definition is here}}55NSString * const TestBaz;  // expected-error {{redefinition of 'TestBaz' with a different type}}56