[PATCH] D122520: [BOLT][test] Fix AArch64 cross-platform tests

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 19:11:08 PDT 2022


maksfb created this revision.
maksfb added reviewers: yota9, Amir, ayermolo, rafauler.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
maksfb requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Use target-specific flags for building AArch64 non-runnable tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122520

Files:
  bolt/test/AArch64/double_jump.cpp
  bolt/test/AArch64/lit.local.cfg
  bolt/test/AArch64/tailcall_traps.s


Index: bolt/test/AArch64/tailcall_traps.s
===================================================================
--- bolt/test/AArch64/tailcall_traps.s
+++ bolt/test/AArch64/tailcall_traps.s
@@ -17,12 +17,12 @@
 
   .text
   .align 4
-  .global main
-  .type main, %function
-main:
+  .global _start
+  .type _start, %function
+_start:
   nop
   ret
-  .size main, .-main
+  .size _start, .-_start
 
   .global foo
   .type foo, %function
Index: bolt/test/AArch64/lit.local.cfg
===================================================================
--- bolt/test/AArch64/lit.local.cfg
+++ bolt/test/AArch64/lit.local.cfg
@@ -1,2 +1,6 @@
 if 'AArch64' not in config.root.targets:
     config.unsupported = True
+
+config.substitutions.insert(
+  0, ('%cflags',
+      '%cflags --target=aarch64-pc-linux -nostartfiles -nostdlib -fuse-ld=lld'))
Index: bolt/test/AArch64/double_jump.cpp
===================================================================
--- bolt/test/AArch64/double_jump.cpp
+++ bolt/test/AArch64/double_jump.cpp
@@ -52,4 +52,4 @@
   return count;
 }
 
-int main(int argc, const char *argv[]) { return foo(38); }
+extern "C" int start() { return foo(38); }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122520.418368.patch
Type: text/x-patch
Size: 1165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220326/36e254dc/attachment.bin>


More information about the llvm-commits mailing list