Skip to content

Commit 5679a3c

Browse files
committed
[BOLT][test] Fix AArch64 cross-platform tests
Use target-specific flags for building AArch64 non-runnable tests. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D122520
1 parent e24f534 commit 5679a3c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

bolt/test/AArch64/double_jump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ unsigned long foo(unsigned long count) {
5252
return count;
5353
}
5454

55-
int main(int argc, const char *argv[]) { return foo(38); }
55+
extern "C" int _start() { return foo(38); }

bolt/test/AArch64/lit.local.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
if config.host_arch not in ['aarch64']:
22
config.unsupported = True
3+
4+
config.substitutions.insert(
5+
0, ('%cflags',
6+
'%cflags --target=aarch64-pc-linux -nostartfiles -nostdlib -fuse-ld=lld'
7+
' -Wl,--unresolved-symbols=ignore-all'))

bolt/test/AArch64/tailcall_traps.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
.text
1919
.align 4
20-
.global main
21-
.type main, %function
22-
main:
20+
.global _start
21+
.type _start, %function
22+
_start:
2323
nop
2424
ret
25-
.size main, .-main
25+
.size _start, .-_start
2626

2727
.global foo
2828
.type foo, %function

0 commit comments

Comments
 (0)