From f0f5d19a36e793dc10eb5ca71c44e591ad4c81c8 Mon Sep 17 00:00:00 2001 From: Maksim Panchenko Date: Mon, 4 Apr 2022 18:01:10 -0700 Subject: [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 --- bolt/test/X86/Inputs/tailcall_traps.s | 6 +++--- bolt/test/X86/cfi-instrs-count.s | 5 ----- bolt/test/X86/false-jump-table.s | 2 +- bolt/test/X86/inline-debug-info.test | 2 +- bolt/test/X86/issue26.s | 3 +++ bolt/test/X86/lit.local.cfg | 5 +++++ bolt/test/X86/loop-inversion-pass.s | 3 +++ bolt/test/X86/loop-nest.test | 4 ++-- bolt/test/X86/split-func-jump-table-fragment-reverse.s | 7 +++++++ bolt/test/X86/tail-duplication-jt.s | 2 +- bolt/test/X86/tail-duplication-pass.s | 2 ++ 11 files changed, 28 insertions(+), 13 deletions(-) (limited to 'bolt') 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: -- cgit v1.2.3