File tree 2 files changed +12
-6
lines changed
SingleSource/UnitTests/AArch64
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
1
if (CMAKE_C_COMPILER_ID STREQUAL "Clang" )
2
+ if (TARGET_OS STREQUAL "Linux" )
3
+ list (APPEND CFLAGS --rtlib=compiler-rt)
4
+ list (APPEND LDFLAGS --rtlib=compiler-rt)
5
+ endif ()
2
6
if (ARCH STREQUAL "AArch64" )
3
- set (Source )
4
- # TODO: this test is currently only supported on Darwin platforms:
5
- if (TARGET_OS MATCHES "Darwin" )
6
- list (APPEND Source acle-fmv-features.c)
7
- endif ()
8
7
llvm_singlesource(PREFIX "aarch64-" )
9
8
endif ()
10
9
endif ()
Original file line number Diff line number Diff line change @@ -196,7 +196,14 @@ CHECK(ssbs2, {
196
196
CHECK (bti , {
197
197
// The only test for this requires reading a register that is only
198
198
// accessible to EL1.
199
- #if defined(__APPLE__ )
199
+ #ifdef __linux__
200
+ int val = 0 ;
201
+ asm volatile ("mrs %0, ID_AA64PFR1_EL1" : "=r" (val ));
202
+ // ID_AA64PFR1_EL1.BT, bits [3:0] = 0b0001 if Branch Target Identification
203
+ // mechanism implemented.
204
+ if ((val & 0xF ) != 0x1 )
205
+ return false;
206
+ #elif defined(__APPLE__ )
200
207
// On Apple platforms, we need to check a sysctl.
201
208
int32_t val = 0 ;
202
209
size_t size = sizeof (val );
You can’t perform that action at this time.
0 commit comments