14188760f6bb20f91c6883dffd89204419f852deeJohn McCall// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
24188760f6bb20f91c6883dffd89204419f852deeJohn McCall
34188760f6bb20f91c6883dffd89204419f852deeJohn McCallvoid test0() __attribute__((visibility("default")));
44188760f6bb20f91c6883dffd89204419f852deeJohn McCallvoid test1() __attribute__((visibility("hidden")));
54188760f6bb20f91c6883dffd89204419f852deeJohn McCallvoid test2() __attribute__((visibility("internal")));
64188760f6bb20f91c6883dffd89204419f852deeJohn McCall
74188760f6bb20f91c6883dffd89204419f852deeJohn McCall// rdar://problem/10753392
84188760f6bb20f91c6883dffd89204419f852deeJohn McCallvoid test3() __attribute__((visibility("protected"))); // expected-warning {{target does not support 'protected' visibility; using 'default'}}
94188760f6bb20f91c6883dffd89204419f852deeJohn McCall
1045a0b264512ee0e9ba874bb3bfeb7f5b96789117Rafael Espindolastruct __attribute__((visibility("hidden"))) test4; // expected-note {{previous attribute is here}}
114e31b4d6cf25029aa280d691e9023359c0ef4204Rafael Espindolastruct test4;
1245a0b264512ee0e9ba874bb3bfeb7f5b96789117Rafael Espindolastruct __attribute__((visibility("default"))) test4; // expected-error {{visibility does not match previous declaration}}
13548d17c977959a5ed395ea1a407901f1314e575cRafael Espindola
14548d17c977959a5ed395ea1a407901f1314e575cRafael Espindolastruct test5;
15548d17c977959a5ed395ea1a407901f1314e575cRafael Espindolastruct __attribute__((visibility("hidden"))) test5; // expected-note {{previous attribute is here}}
16548d17c977959a5ed395ea1a407901f1314e575cRafael Espindolastruct __attribute__((visibility("default"))) test5; // expected-error {{visibility does not match previous declaration}}
179b79fc9c57dc9d541c2a5737c3e2c24cc68d485dRafael Espindola
189b79fc9c57dc9d541c2a5737c3e2c24cc68d485dRafael Espindolavoid test6() __attribute__((visibility("hidden"), // expected-note {{previous attribute is here}}
199b79fc9c57dc9d541c2a5737c3e2c24cc68d485dRafael Espindola                            visibility("default"))); // expected-error {{visibility does not match previous declaration}}
2098ae834a3e289f84f0765d0d0ca7ff22ccaba458Rafael Espindola
2198ae834a3e289f84f0765d0d0ca7ff22ccaba458Rafael Espindolaextern int test7 __attribute__((visibility("default"))); // expected-note {{previous attribute is here}}
2298ae834a3e289f84f0765d0d0ca7ff22ccaba458Rafael Espindolaextern int test7 __attribute__((visibility("hidden"))); // expected-error {{visibility does not match previous declaration}}
23dd44f34301316b814277d6a8c146d86c7115330bRafael Espindola
24dd44f34301316b814277d6a8c146d86c7115330bRafael Espindolatypedef int __attribute__((visibility("default"))) bar; // expected-warning {{visibility attribute ignored}}
25