annotate clang/test/Sema/attr-visibility.c @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 void test0() __attribute__((visibility("default")));
anatofuz
parents:
diff changeset
4 void test1() __attribute__((visibility("hidden")));
anatofuz
parents:
diff changeset
5 void test2() __attribute__((visibility("internal")));
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 // rdar://problem/10753392
anatofuz
parents:
diff changeset
8 void test3() __attribute__((visibility("protected"))); // expected-warning {{target does not support 'protected' visibility; using 'default'}}
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 struct __attribute__((visibility("hidden"))) test4; // expected-note {{previous attribute is here}}
anatofuz
parents:
diff changeset
11 struct test4;
anatofuz
parents:
diff changeset
12 struct __attribute__((visibility("default"))) test4; // expected-error {{visibility does not match previous declaration}}
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 struct test5;
anatofuz
parents:
diff changeset
15 struct __attribute__((visibility("hidden"))) test5; // expected-note {{previous attribute is here}}
anatofuz
parents:
diff changeset
16 struct __attribute__((visibility("default"))) test5; // expected-error {{visibility does not match previous declaration}}
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 void test6() __attribute__((visibility("default"), // expected-error {{visibility does not match previous declaration}}
anatofuz
parents:
diff changeset
19 visibility("hidden"))); // expected-note {{previous attribute is here}}
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 extern int test7 __attribute__((visibility("default"))); // expected-note {{previous attribute is here}}
anatofuz
parents:
diff changeset
22 extern int test7 __attribute__((visibility("hidden"))); // expected-error {{visibility does not match previous declaration}}
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 typedef int __attribute__((visibility("default"))) bar; // expected-warning {{'visibility' attribute ignored}}
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 int x __attribute__((type_visibility("default"))); // expected-error {{'type_visibility' attribute only applies to types and namespaces}}
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 int PR17105 __attribute__((visibility(hidden))); // expected-error {{'visibility' attribute requires a string}}