1 // RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s
3 void threeClauses(void) __attribute__((external_source_symbol(language
="Swift", defined_in
="module", generated_declaration
)));
5 void twoClauses(void) __attribute__((external_source_symbol(language
="Swift", defined_in
="module")));
7 void fourClauses(void) __attribute__((external_source_symbol(language
="Swift", defined_in
="module", generated_declaration
, USR
="test")));
9 void fiveClauses(void) __attribute__((external_source_symbol(language
="Swift", defined_in
="module", generated_declaration
, generated_declaration
, USR
="test"))); // expected-error {{duplicate 'generated_declaration' clause in an 'external_source_symbol' attribute}}
11 void oneClause(void) __attribute__((external_source_symbol(generated_declaration
)));
13 void noArguments(void)
14 __attribute__((external_source_symbol
)); // expected-error {{'external_source_symbol' attribute takes at least 1 argument}}
16 void namedDeclsOnly(void) {
17 int (^block
)(void) = ^ (void)
18 __attribute__((external_source_symbol(language
="Swift"))) { // expected-warning {{'external_source_symbol' attribute only applies to named declarations}}
23 [[clang::external_source_symbol(language
="Swift", defined_in
="module", generated_declaration
)]] void threeClauses2(void);
25 [[clang::external_source_symbol(language
="Swift", defined_in
="module")]] void twoClauses2(void);
27 [[clang::external_source_symbol(language
="Swift", defined_in
="module", USR
="test", generated_declaration
, generated_declaration
)]] // expected-error {{duplicate 'generated_declaration' clause in an 'external_source_symbol' attribute}}
28 void fiveClauses2(void);
30 [[clang::external_source_symbol(generated_declaration
)]] void oneClause2(void);
32 [[clang::external_source_symbol
]] // expected-error {{'external_source_symbol' attribute takes at least 1 argument}}
33 void noArguments2(void);