From 2f3285989ece24d055b54ca0f44d716f4a03889c Mon Sep 17 00:00:00 2001 From: Rafael Auler Date: Wed, 17 Nov 2021 15:38:36 -0800 Subject: [PATCH] [BOLT] Fix tailcall-traps and basic-instr tests on ubuntu Summary: These tests are failing on opensource ubuntu. (cherry picked from FBD32514489) --- bolt/test/X86/Inputs/tailcall_traps.s | 1 + bolt/test/X86/tailcall-traps.test | 2 +- bolt/test/runtime/X86/Inputs/basic-instrumentation.s | 9 +++++++++ bolt/test/runtime/X86/basic-instrumentation.test | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 bolt/test/runtime/X86/Inputs/basic-instrumentation.s diff --git a/bolt/test/X86/Inputs/tailcall_traps.s b/bolt/test/X86/Inputs/tailcall_traps.s index 3cfda3670129..cd2e5625bd35 100644 --- a/bolt/test/X86/Inputs/tailcall_traps.s +++ b/bolt/test/X86/Inputs/tailcall_traps.s @@ -15,3 +15,4 @@ bar: .globl moo moo: + nop diff --git a/bolt/test/X86/tailcall-traps.test b/bolt/test/X86/tailcall-traps.test index bbfbb8f8b8d5..5f075cf20477 100644 --- a/bolt/test/X86/tailcall-traps.test +++ b/bolt/test/X86/tailcall-traps.test @@ -1,6 +1,6 @@ # Tests the peephole that adds trap instructions following indirect tail calls. -RUN: %clang %p/Inputs/tailcall_traps.s -o %t.exe +RUN: %clang %cflags %p/Inputs/tailcall_traps.s -o %t.exe RUN: llvm-bolt %t.exe -o %t -peepholes=tailcall-traps \ RUN: -print-peepholes -funcs=foo,bar 2>&1 | FileCheck %s diff --git a/bolt/test/runtime/X86/Inputs/basic-instrumentation.s b/bolt/test/runtime/X86/Inputs/basic-instrumentation.s new file mode 100644 index 000000000000..388d2cdbd085 --- /dev/null +++ b/bolt/test/runtime/X86/Inputs/basic-instrumentation.s @@ -0,0 +1,9 @@ + .globl main + .type main, %function +main: + pushq %rbp + movq %rsp, %rbp + movl $0x0, %eax + popq %rbp + retq +.size main, .-main diff --git a/bolt/test/runtime/X86/basic-instrumentation.test b/bolt/test/runtime/X86/basic-instrumentation.test index 0746974433e9..cb99868b1e43 100644 --- a/bolt/test/runtime/X86/basic-instrumentation.test +++ b/bolt/test/runtime/X86/basic-instrumentation.test @@ -1,8 +1,8 @@ -# Try to instrument a very fast test. varargs will not execute any code during +# Try to instrument a very fast test. Input bin will not execute any code during # runtime besides returning zero in main, so it is a good trivial case. REQUIRES: system-linux -RUN: %clang %p/../../Inputs/vararg.s -Wl,-q -o %t.exe +RUN: %clang %p/Inputs/basic-instrumentation.s -Wl,-q -o %t.exe RUN: llvm-bolt %t.exe -o %t -instrument \ RUN: -instrumentation-file=%t \ RUN: -instrumentation-file-append-pid