1 // RUN: %clang_cc1 -verify=expected,enabled -emit-codegen-only %s
2 // RUN: %clang_cc1 -verify -emit-codegen-only -Wno-attribute-warning %s
4 __attribute__((error("oh no foo"))) void foo(void);
6 __attribute__((error("oh no bar"))) void bar(void);
12 __attribute__((warning("oh no quux"))) void quux(void);
14 __attribute__((error("demangle me"))) void __compiletime_assert_455(void);
16 __attribute__((error("one"), error("two"))) // expected-warning {{attribute 'error' is already applied with different arguments}}
17 void // expected-note@-1 {{previous attribute is here}}
18 duplicate_errors(void);
20 __attribute__((warning("one"), warning("two"))) // expected-warning {{attribute 'warning' is already applied with different arguments}}
21 void // expected-note@-1 {{previous attribute is here}}
22 duplicate_warnings(void);
25 foo(); // expected-error {{call to 'foo' declared with 'error' attribute: oh no foo}}
27 bar(); // expected-error {{call to 'bar' declared with 'error' attribute: oh no bar}}
29 quux(); // enabled-warning {{call to 'quux' declared with 'warning' attribute: oh no quux}}
30 __compiletime_assert_455(); // expected-error {{call to '__compiletime_assert_455' declared with 'error' attribute: demangle me}}
31 duplicate_errors(); // expected-error {{call to 'duplicate_errors' declared with 'error' attribute: two}}
32 duplicate_warnings(); // enabled-warning {{call to 'duplicate_warnings' declared with 'warning' attribute: two}}