annotate clang/test/Sema/attr-external-source-symbol.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children 5f17cb93ff66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -fblocks -verify -fdouble-square-bracket-attributes %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 void threeClauses() __attribute__((external_source_symbol(language="Swift", defined_in="module", generated_declaration)));
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 void twoClauses() __attribute__((external_source_symbol(language="Swift", defined_in="module")));
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
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}}
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 void oneClause() __attribute__((external_source_symbol(generated_declaration)));
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 void noArguments()
anatofuz
parents:
diff changeset
12 __attribute__((external_source_symbol)); // expected-error {{'external_source_symbol' attribute takes at least 1 argument}}
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 void namedDeclsOnly() {
anatofuz
parents:
diff changeset
15 int (^block)(void) = ^ (void)
anatofuz
parents:
diff changeset
16 __attribute__((external_source_symbol(language="Swift"))) { // expected-warning {{'external_source_symbol' attribute only applies to named declarations}}
anatofuz
parents:
diff changeset
17 return 1;
anatofuz
parents:
diff changeset
18 };
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 void threeClauses2() [[clang::external_source_symbol(language="Swift", defined_in="module", generated_declaration)]];
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 void twoClauses2() [[clang::external_source_symbol(language="Swift", defined_in="module")]];
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 void fourClauses2()
anatofuz
parents:
diff changeset
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}}
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 void oneClause2() [[clang::external_source_symbol(generated_declaration)]];
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 void noArguments2()
anatofuz
parents:
diff changeset
31 [[clang::external_source_symbol]]; // expected-error {{'external_source_symbol' attribute takes at least 1 argument}}