Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bolt
diff options
context:
space:
mode:
authorMaksim Panchenko <maks@fb.com>2022-04-05 04:01:10 +0300
committerMaksim Panchenko <maks@fb.com>2022-04-05 08:25:42 +0300
commitf0f5d19a36e793dc10eb5ca71c44e591ad4c81c8 (patch)
tree65797aec2fb65e4dc36dfbeb1e22c5636e5b1c75 /bolt
parent4875ff1dc90bba089a5a14023d5eec69490b0422 (diff)
[BOLT][test] Fix X86 cross-platform tests
Use target-specific flags for building X86 non-runnable tests. Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D123072
Diffstat (limited to 'bolt')
-rw-r--r--bolt/test/X86/Inputs/tailcall_traps.s6
-rw-r--r--bolt/test/X86/cfi-instrs-count.s5
-rwxr-xr-xbolt/test/X86/false-jump-table.s2
-rw-r--r--bolt/test/X86/inline-debug-info.test2
-rwxr-xr-xbolt/test/X86/issue26.s3
-rw-r--r--bolt/test/X86/lit.local.cfg5
-rw-r--r--bolt/test/X86/loop-inversion-pass.s3
-rw-r--r--bolt/test/X86/loop-nest.test4
-rw-r--r--bolt/test/X86/split-func-jump-table-fragment-reverse.s7
-rw-r--r--bolt/test/X86/tail-duplication-jt.s2
-rw-r--r--bolt/test/X86/tail-duplication-pass.s2
11 files changed, 28 insertions, 13 deletions
diff --git a/bolt/test/X86/Inputs/tailcall_traps.s b/bolt/test/X86/Inputs/tailcall_traps.s
index cd2e5625bd35..5fb60d94fc4c 100644
--- a/bolt/test/X86/Inputs/tailcall_traps.s
+++ b/bolt/test/X86/Inputs/tailcall_traps.s
@@ -1,18 +1,18 @@
-.globl main
-main:
-
.globl foo
foo:
.cfi_startproc
jmpq *%rax
.cfi_endproc
+.size foo, .-foo
.globl bar
bar:
.cfi_startproc
jmp moo
.cfi_endproc
+.size bar, .-bar
.globl moo
moo:
nop
+.size moo, .-moo
diff --git a/bolt/test/X86/cfi-instrs-count.s b/bolt/test/X86/cfi-instrs-count.s
index bd2235b484f7..c74e940a41f8 100644
--- a/bolt/test/X86/cfi-instrs-count.s
+++ b/bolt/test/X86/cfi-instrs-count.s
@@ -109,8 +109,3 @@ _Z7catchitv:
.cfi_endproc
.size _Z7catchitv, .-_Z7catchitv
-.set "_Z5raisev", 0
-.set _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc, 0
-.set _ZNSolsEPFRSoS_E, 0
-.set __cxa_begin_catch, 0
-.set __cxa_end_catch, 0
diff --git a/bolt/test/X86/false-jump-table.s b/bolt/test/X86/false-jump-table.s
index 8787f2c4e339..8f969b7ec822 100755
--- a/bolt/test/X86/false-jump-table.s
+++ b/bolt/test/X86/false-jump-table.s
@@ -45,7 +45,7 @@ inc_dup:
# CHECK: leaq "JUMP_TABLE{{.*}}"(%rip), %rdx
leaq .L4(%rip), %rdx
jmp .LJT
-# CHECK: leaq DATAat{{.*}}(%rip), %rdx
+# CHECK: leaq {{.*}}(%rip), %rdx
leaq .LC0(%rip), %rdx
jmp .L10
.LJT:
diff --git a/bolt/test/X86/inline-debug-info.test b/bolt/test/X86/inline-debug-info.test
index 300fa0be7891..5a1b8965470e 100644
--- a/bolt/test/X86/inline-debug-info.test
+++ b/bolt/test/X86/inline-debug-info.test
@@ -10,7 +10,7 @@
# RUN: | FileCheck %s
## The call to puts() should come from inline-foo.c:
-# CHECK: callq puts@PLT # debug line {{.*}}inline-foo.c:4:3
+# CHECK: callq {{.*}} # debug line {{.*}}inline-foo.c:4:3
# RUN: llvm-objdump --disassemble-symbols=main -d --line-numbers %t.bolt \
# RUN: | FileCheck %s -check-prefix=CHECK-OBJDUMP
diff --git a/bolt/test/X86/issue26.s b/bolt/test/X86/issue26.s
index a3faea8bcdee..bf383eb47bbe 100755
--- a/bolt/test/X86/issue26.s
+++ b/bolt/test/X86/issue26.s
@@ -53,4 +53,7 @@ FUNC:
main:
xorq %rax, %rax
retq
+
+# For relocations against .text
+ call exit
.Lend2:
diff --git a/bolt/test/X86/lit.local.cfg b/bolt/test/X86/lit.local.cfg
index 7d0b9ea5a8b5..fa9e680822d4 100644
--- a/bolt/test/X86/lit.local.cfg
+++ b/bolt/test/X86/lit.local.cfg
@@ -1,2 +1,7 @@
if config.host_arch not in ['x86', 'X86', 'x86_64']:
config.unsupported = True
+
+config.substitutions.insert(
+ 0, ('%cflags',
+ '%cflags --target=x86_64--pc-linux -nostartfiles -nostdlib -fuse-ld=lld'
+ ' -Wl,--unresolved-symbols=ignore-all'))
diff --git a/bolt/test/X86/loop-inversion-pass.s b/bolt/test/X86/loop-inversion-pass.s
index 38d3c2af23fe..d203a3bb5a38 100644
--- a/bolt/test/X86/loop-inversion-pass.s
+++ b/bolt/test/X86/loop-inversion-pass.s
@@ -44,4 +44,7 @@ main:
cmp $16, %rax
jl .Jloop
retq
+
+# For relocations against .text
+ call exit
.Lend:
diff --git a/bolt/test/X86/loop-nest.test b/bolt/test/X86/loop-nest.test
index 9df3c09007eb..0ae800c3ec95 100644
--- a/bolt/test/X86/loop-nest.test
+++ b/bolt/test/X86/loop-nest.test
@@ -9,8 +9,8 @@ RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
RUN: llvm-bolt %t.exe -o %t -data=%t.fdata \
RUN: -print-cfg -print-loops -sequential-disassembly -lite=0 2>&1 | FileCheck %s
-CHECK: Binary Function "main" after building cfg
-CHECK: Loop Info for Function "main"
+CHECK: Binary Function "main{{.*}}" after building cfg
+CHECK: Loop Info for Function "main{{.*}}"
CHECK: Outer loop header: .Ltmp[[#MAIN_OUTER_HDR:]]
CHECK-NEXT: Loop basic blocks: .Ltmp[[#MAIN_OUTER_HDR]], .Ltmp[[#]]
diff --git a/bolt/test/X86/split-func-jump-table-fragment-reverse.s b/bolt/test/X86/split-func-jump-table-fragment-reverse.s
index b640c982cadf..4b9b51132170 100644
--- a/bolt/test/X86/split-func-jump-table-fragment-reverse.s
+++ b/bolt/test/X86/split-func-jump-table-fragment-reverse.s
@@ -12,6 +12,13 @@
# CHECK-NOT: unclaimed PC-relative relocations left in data
# CHECK: BOLT-INFO: marking main.cold as a fragment of main
.text
+ .globl _start
+ .type _start, %function
+_start:
+ callq main.cold
+ call exit
+.size _start, .-_start
+
.globl main.cold
.type main.cold, %function
.p2align 2
diff --git a/bolt/test/X86/tail-duplication-jt.s b/bolt/test/X86/tail-duplication-jt.s
index 3d31157d98c7..0d6918c3b8a4 100644
--- a/bolt/test/X86/tail-duplication-jt.s
+++ b/bolt/test/X86/tail-duplication-jt.s
@@ -11,7 +11,7 @@
# RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -relocs \
# RUN: -tail-duplication=1 -tail-duplication-aggressive=1 \
# RUN: -print-cfg | FileCheck %s
-# CHECK: Jump table JUMP_TABLE/a.0 for function a at {{.*}} with a total count of 3
+# CHECK: Jump table {{.*}} for function a at {{.*}} with a total count of 3
.globl main
main:
.globl a
diff --git a/bolt/test/X86/tail-duplication-pass.s b/bolt/test/X86/tail-duplication-pass.s
index 37f8fa12047f..81c4515a9d1e 100644
--- a/bolt/test/X86/tail-duplication-pass.s
+++ b/bolt/test/X86/tail-duplication-pass.s
@@ -23,4 +23,6 @@ main:
inc %rax
.BB2:
retq
+# For relocations against .text
+ call exit
.Lend: