150
|
1 // RUN: %clang_cc1 -fsyntax-only -fblocks -verify -fdouble-square-bracket-attributes %s
|
|
2
|
|
3 void threeClauses() __attribute__((external_source_symbol(language="Swift", defined_in="module", generated_declaration)));
|
|
4
|
|
5 void twoClauses() __attribute__((external_source_symbol(language="Swift", defined_in="module")));
|
|
6
|
|
7 void fourClauses() __attribute__((external_source_symbol(language="Swift", defined_in="module", generated_declaration, generated_declaration))); // expected-error {{duplicate 'generated_declaration' clause in an 'external_source_symbol' attribute}}
|
|
8
|
|
9 void oneClause() __attribute__((external_source_symbol(generated_declaration)));
|
|
10
|
|
11 void noArguments()
|
|
12 __attribute__((external_source_symbol)); // expected-error {{'external_source_symbol' attribute takes at least 1 argument}}
|
|
13
|
|
14 void namedDeclsOnly() {
|
|
15 int (^block)(void) = ^ (void)
|
|
16 __attribute__((external_source_symbol(language="Swift"))) { // expected-warning {{'external_source_symbol' attribute only applies to named declarations}}
|
|
17 return 1;
|
|
18 };
|
|
19 }
|
|
20
|
|
21 void threeClauses2() [[clang::external_source_symbol(language="Swift", defined_in="module", generated_declaration)]];
|
|
22
|
|
23 void twoClauses2() [[clang::external_source_symbol(language="Swift", defined_in="module")]];
|
|
24
|
|
25 void fourClauses2()
|
|
26 [[clang::external_source_symbol(language="Swift", defined_in="module", generated_declaration, generated_declaration)]]; // expected-error {{duplicate 'generated_declaration' clause in an 'external_source_symbol' attribute}}
|
|
27
|
|
28 void oneClause2() [[clang::external_source_symbol(generated_declaration)]];
|
|
29
|
|
30 void noArguments2()
|
|
31 [[clang::external_source_symbol]]; // expected-error {{'external_source_symbol' attribute takes at least 1 argument}}
|