llvm-project/clang/test/CodeGen/builtins-arm-microsoft.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

44 lines
987 B
C

// RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -emit-llvm -o - %s \
// RUN: | FileCheck %s -check-prefix CHECK-MSVC
// RUN: %clang_cc1 -Wno-implicit-function-declaration -triple armv7-eabi -emit-llvm %s -o - \
// RUN: | FileCheck %s -check-prefix CHECK-EABI
// REQUIRES: arm-registered-target
#include <arm_acle.h>
void test_yield_intrinsic() {
__yield();
}
// CHECK-MSVC: call void @llvm.arm.hint(i32 1)
// CHECK-EABI: call void @llvm.arm.hint(i32 1)
void wfe() {
__wfe();
}
// CHECK-MSVC: call {{.*}} @llvm.arm.hint(i32 2)
// CHECK-EABI: call {{.*}} @llvm.arm.hint(i32 2)
void wfi() {
__wfi();
}
// CHECK-MSVC: call {{.*}} @llvm.arm.hint(i32 3)
// CHECK-EABI: call {{.*}} @llvm.arm.hint(i32 3)
void sev() {
__sev();
}
// CHECK-MSVC: call {{.*}} @llvm.arm.hint(i32 4)
// CHECK-EABI: call {{.*}} @llvm.arm.hint(i32 4)
void sevl() {
__sevl();
}
// CHECK-MSVC: call {{.*}} @llvm.arm.hint(i32 5)
// CHECK-EABI: call {{.*}} @llvm.arm.hint(i32 5)