39 lines · plain
1// RUN: %clang_cc1 -verify -fsyntax-only %s2 3// expected-error@+1 {{'__swift_bridge__' attribute takes one argument}}4__attribute__((__swift_bridge__))5@interface I6@end7 8// expected-error@+1 {{expected string literal as argument of '__swift_bridge__' attribute}}9__attribute__((__swift_bridge__(1)))10@interface J11@end12 13// expected-error@+1 {{'__swift_bridge__' attribute takes one argument}}14__attribute__((__swift_bridge__("K", 1)))15@interface K16@end17 18@interface L19// expected-error@+1 {{'__swift_bridge__' attribute only applies to tag types, typedefs, Objective-C interfaces, and Objective-C protocols}}20- (void)method __attribute__((__swift_bridge__("method")));21@end22 23__attribute__((__swift_bridge__("Array")))24@interface NSArray25@end26 27__attribute__((__swift_bridge__("ProtocolP")))28@protocol P29@end30 31typedef NSArray *NSArrayAlias __attribute__((__swift_bridge__("ArrayAlias")));32 33struct __attribute__((__swift_bridge__("StructT"))) T {};34 35// Duplicate attributes with the same arguments are fine.36struct __attribute__((swift_bridge("foo"), swift_bridge("foo"))) S;37// Duplicate attributes with different arguments are not.38struct __attribute__((swift_bridge("foo"), swift_bridge("bar"))) S; // expected-warning {{attribute 'swift_bridge' is already applied with different arguments}}39