llvm-capstone/clang/test/Frontend/backend-attribute-error-warning-optimize.c
Fangrui Song e588d23a91 Add back single quotes when dontcall attribute was split into dontcall-error/dontcall-warn
Single quotes were accidentally dropped in D110364.
2022-11-11 22:59:51 -08: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();
}