2014-03-29 23:09:45 +08:00
|
|
|
// RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s
|
|
|
|
|
|
|
|
void f0(void *a, void *b) {
|
|
|
|
__clear_cache(a,b);
|
|
|
|
// CHECK: call {{.*}} @__clear_cache
|
|
|
|
}
|
2014-06-17 05:56:02 +08:00
|
|
|
|
|
|
|
// CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a)
|
2014-06-17 06:18:26 +08:00
|
|
|
unsigned rbit(unsigned a) {
|
|
|
|
return __builtin_arm_rbit(a);
|
2014-06-17 05:56:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: call {{.*}} @llvm.aarch64.rbit.i64(i64 %a)
|
2014-06-17 06:18:26 +08:00
|
|
|
unsigned long long rbit64(unsigned long long a) {
|
|
|
|
return __builtin_arm_rbit64(a);
|
2014-06-17 05:56:02 +08:00
|
|
|
}
|
2014-07-14 00:17:30 +08:00
|
|
|
|
|
|
|
void hints() {
|
2014-07-14 23:20:09 +08:00
|
|
|
__builtin_arm_nop(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 0)
|
2014-07-14 00:17:30 +08:00
|
|
|
__builtin_arm_yield(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 1)
|
|
|
|
__builtin_arm_wfe(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 2)
|
|
|
|
__builtin_arm_wfi(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 3)
|
|
|
|
__builtin_arm_sev(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 4)
|
|
|
|
__builtin_arm_sevl(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 5)
|
|
|
|
}
|
2014-07-17 18:52:06 +08:00
|
|
|
|
|
|
|
void barriers() {
|
|
|
|
__builtin_arm_dmb(1); //CHECK: call {{.*}} @llvm.aarch64.dmb(i32 1)
|
|
|
|
__builtin_arm_dsb(2); //CHECK: call {{.*}} @llvm.aarch64.dsb(i32 2)
|
|
|
|
__builtin_arm_isb(3); //CHECK: call {{.*}} @llvm.aarch64.isb(i32 3)
|
|
|
|
}
|