llvm-project/clang/test/CodeGen/arm64-former-microsoft-intrinsics-header-warning.c
Nick Sarnie a7f0b29733
[clang][ARM][AArch64] Reapply "Define intrinsics guarded by __has_builtin on all platforms (#128222)" (#140910)
The original change caused issues on MSVC due to a new warning thrown
inside MSVC headers. That was fixed
[here](https://github.com/llvm/llvm-project/pull/142019), so reapply
this commit. Original description below.

Instead of defining ARM ACLE intrinsics only on MSVC and guarding
wrapper functions in headers with __has_builtin, universally define the
intrinsics as target header builtins.
2025-06-04 14:41:59 +00:00

54 lines
1.9 KiB
C

// RUN: %clang_cc1 -triple arm64-windows -Wno-everything -Wimplicit-function-declaration -fms-compatibility -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple arm64-linux -Wno-everything -Wimplicit-function-declaration -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple arm64-darwin -Wno-everything -Wimplicit-function-declaration -fms-compatibility -fsyntax-only -verify %s
void check__dmb(void) {
// expected-warning@+2{{call to undeclared library function}}
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
__dmb(0);
}
void check__dsb(void) {
// expected-warning@+2{{call to undeclared library function}}
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
__dsb(0);
}
void check__isb(void) {
// expected-warning@+2{{call to undeclared library function}}
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
__isb(0);
}
void check__yield(void) {
// expected-warning@+2{{call to undeclared library function}}
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
__yield();
}
void check__wfe(void) {
// expected-warning@+2{{call to undeclared library function}}
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
__wfe();
}
void check__wfi(void) {
// expected-warning@+2{{call to undeclared library function}}
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
__wfi();
}
void check__sev(void) {
// expected-warning@+2{{call to undeclared library function}}
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
__sev();
}
void check__sevl(void) {
// expected-warning@+2{{call to undeclared library function}}
// expected-note@+1{{include the header <arm_acle.h> or explicitly provide a declaration for}}
__sevl();
}