llvm-project/clang/test/Frontend/backend-attribute-error-warning-optimize.c
Arthur Eubanks 7833d20f1f Revert "[clang] Rework dontcall attributes"
This reverts commit 2943071e2ee0c7f31f34062a44d12aeb0e3a66fd.

Breaks bots
2021-09-28 14:49:27 -07:00

23 lines
449 B
C

// RUN: %clang_cc1 -O2 -verify -emit-codegen-only %s
__attribute__((error("oh no foo"))) void foo(void);
__attribute__((error("oh no bar"))) void bar(void);
int x(void) {
return 8 % 2 == 1;
}
void baz(void) {
foo(); // expected-error {{call to 'foo' declared with 'error' attribute: oh no foo}}
if (x())
bar();
}
// FIXME: indirect call detection not yet supported.
void (*quux)(void);
void indirect(void) {
quux = foo;
quux();
}