1## Test the double jump removal peephole. 2 3## This test has commands that rely on shell capabilities that won't execute 4## correctly on Windows e.g. subshell execution 5REQUIRES: shell 6 7RUN: %clangxx %cxxflags %p/Inputs/double_jump.cpp -o %t.exe 8RUN: (llvm-bolt %t.exe --peepholes=double-jumps \ 9RUN: --eliminate-unreachable -o %t 2>&1 \ 10RUN: && llvm-objdump -d %t --print-imm-hex --no-show-raw-insn) | FileCheck %s 11 12CHECK: BOLT-INFO: Peephole: 1 double jumps patched. 13 14CHECK: <_Z3foom>: 15CHECK-NEXT: pushq %rbp 16CHECK-NEXT: movq %rsp, %rbp 17CHECK-NEXT: movq %rdi, -0x8(%rbp) 18CHECK-NEXT: cmpq $0x1, -0x8(%rbp) 19CHECK-NEXT: je {{.*}} <_Z3foom+0x2c> 20CHECK-NEXT: incq -0x8(%rbp) 21CHECK-NEXT: incq -0x8(%rbp) 22CHECK-NEXT: cmpq $0x2, -0x8(%rbp) 23CHECK-NEXT: je {{.*}} <_Z3foom+0x22> 24CHECK-NEXT: incq -0x8(%rbp) 25CHECK-NEXT: movq -0x8(%rbp), %rdi 26CHECK-NEXT: popq %rbp 27CHECK-NEXT: jmp {{.*}} <bar> 28CHECK-NEXT: popq %rbp 29CHECK-NEXT: incq -0x8(%rbp) 30CHECK-NEXT: jmp {{.*}} <bar> 31