Files
clang-p2996/bolt/test/X86/double-jump.test
Amir Ayupov 8331f75e28 [BOLT][TEST] Rename tests to follow standard naming scheme
Summary:
The majority of tests in LLVM projects are using - instead of _ in the name,
i.e. `check-something.test` is preferred over `check_something.test`.

It makes sense for us to adopt the same naming scheme for our future tests and
to rename existing ones.

(cherry picked from FBD32185879)
2021-11-04 13:36:15 -07:00

27 lines
839 B
Plaintext

# Test the double jump removqal peephole.
RUN: %clang %cflags %p/Inputs/double_jump.cpp -o %t.exe
RUN: (llvm-bolt %t.exe -peepholes=double-jumps \
RUN: -eliminate-unreachable -o %t 2>&1 \
RUN: && llvm-objdump -d %t --print-imm-hex --no-show-raw-insn) | FileCheck %s
CHECK: BOLT-INFO: Peephole: 1 double jumps patched.
CHECK: <_Z3foom>:
CHECK-NEXT: pushq %rbp
CHECK-NEXT: movq %rsp, %rbp
CHECK-NEXT: movq %rdi, -0x8(%rbp)
CHECK-NEXT: cmpq $0x1, -0x8(%rbp)
CHECK-NEXT: je {{.*}} <_Z3foom+0x2c>
CHECK-NEXT: incq -0x8(%rbp)
CHECK-NEXT: incq -0x8(%rbp)
CHECK-NEXT: cmpq $0x2, -0x8(%rbp)
CHECK-NEXT: je {{.*}} <_Z3foom+0x22>
CHECK-NEXT: incq -0x8(%rbp)
CHECK-NEXT: movq -0x8(%rbp), %rdi
CHECK-NEXT: popq %rbp
CHECK-NEXT: jmp {{.*}} <bar>
CHECK-NEXT: popq %rbp
CHECK-NEXT: incq -0x8(%rbp)
CHECK-NEXT: jmp {{.*}} <bar>