annotate clang/test/Sema/internal_linkage.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 c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify -fdouble-square-bracket-attributes %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 int var __attribute__((internal_linkage));
anatofuz
parents:
diff changeset
4 int var2 __attribute__((internal_linkage,common)); // expected-error{{'common' and 'internal_linkage' attributes are not compatible}} \
anatofuz
parents:
diff changeset
5 // expected-note{{conflicting attribute is here}}
anatofuz
parents:
diff changeset
6 int var3 __attribute__((common,internal_linkage)); // expected-error{{'internal_linkage' and 'common' attributes are not compatible}} \
anatofuz
parents:
diff changeset
7 // expected-note{{conflicting attribute is here}}
anatofuz
parents:
diff changeset
8
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
9 int var4 __attribute__((common)); // expected-note{{previous definition is here}} expected-note{{conflicting attribute is here}}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
10 int var4 __attribute__((internal_linkage)); // expected-error{{'internal_linkage' and 'common' attributes are not compatible}} \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
11 // expected-error{{'internal_linkage' attribute does not appear on the first declaration of 'var4'}}
150
anatofuz
parents:
diff changeset
12
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
13 int var5 __attribute__((internal_linkage)); // expected-note{{conflicting attribute is here}}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
14 int var5 __attribute__((common)); // expected-error{{'common' and 'internal_linkage' attributes are not compatible}}
150
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 __attribute__((internal_linkage)) int f() {}
anatofuz
parents:
diff changeset
17 struct __attribute__((internal_linkage)) S { // expected-warning{{'internal_linkage' attribute only applies to variables, functions, and classes}}
anatofuz
parents:
diff changeset
18 };
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 __attribute__((internal_linkage("foo"))) int g() {} // expected-error{{'internal_linkage' attribute takes no arguments}}
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 int var6 [[clang::internal_linkage]];
anatofuz
parents:
diff changeset
23 int var7 [[clang::internal_linkage]] __attribute__((common)); // expected-error{{'internal_linkage' and 'common' attributes are not compatible}} \
anatofuz
parents:
diff changeset
24 // expected-note{{conflicting attribute is here}}
anatofuz
parents:
diff changeset
25 __attribute__((common)) int var8 [[clang::internal_linkage]]; // expected-error{{'internal_linkage' and 'common' attributes are not compatible}} \
anatofuz
parents:
diff changeset
26 // expected-note{{conflicting attribute is here}}