1REQUIRES: system-linux
2
3RUN: %clangxx %cxxflags -pie -fPIC %p/Inputs/pie-exceptions-failed-split.s \
4RUN:   -Wl,-q -o %t
5RUN: llvm-bolt %t -o %t.instr --instrument --instrumentation-file=%t.fdata
6
7## Record profile with invocation that does not throw exceptions.
8RUN: %t.instr
9
10RUN: llvm-bolt %t -o %t.bolt --data %t.fdata --reorder-blocks=ext-tsp \
11RUN:   --split-functions --split-eh --print-after-lowering \
12RUN:   --print-only=_Z10throw_testiPPc 2>&1 | FileCheck %s
13
14## Hot code in the test case gets larger after splitting because of jump
15## instruction relaxation. Check that BOLT reverts the split correctly.
16CHECK: Binary Function "_Z10throw_testiPPc"
17CHECK: IsSplit :
18CHECK-SAME: 0
19
20## Check that the landing pad trampoline was created, but contains no
21## instructions and falls to the real landing pad.
22CHECK: {{^[^[:space:]]+}} (0 instructions
23CHECK-NEXT: Landing Pad{{$}}
24CHECK: Exec Count
25CHECK-SAME: : 0
26CHECK: Successors:
27CHECK-SAME: [[LP:[^[:space:]]+]]
28CHECK-EMPTY:
29CHECK-NEXT: [[LP]]
30CHECK-DAG: Exec Count
31CHECK-NOT: Exec Count
32CHECK-DAG: callq   __cxa_begin_catch
33
34## Verify the output still executes correctly when the exception path is being
35## taken.
36RUN: %t.bolt arg1 arg2 arg3
37