[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Frontend / backend-attribute-error-warning-optimize.c
blobd3951e3b6b1f57dab64b7b7e7fb486084992b94d
1 // RUN: %clang_cc1 -O2 -verify -emit-codegen-only %s
3 __attribute__((error("oh no foo"))) void foo(void);
5 __attribute__((error("oh no bar"))) void bar(void);
7 int x(void) {
8 return 8 % 2 == 1;
10 void baz(void) {
11 foo(); // expected-error {{call to 'foo' declared with 'error' attribute: oh no foo}}
12 if (x())
13 bar();
16 // FIXME: indirect call detection not yet supported.
17 void (*quux)(void);
19 void indirect(void) {
20 quux = foo;
21 quux();