1 ## Check that BOLT successfully splits C++ exception-handling code for
2 ## PIEs or shared objects.
4 REQUIRES: system-linux,bolt-runtime
6 RUN: %clangxx %cxxflags -pie -fPIC %p/Inputs/exceptions_split.cpp -Wl,-q -o %t
7 RUN: llvm-bolt %t -o %t.instr --instrument --instrumentation-file=%t.fdata
9 ## Record profile with invocation that does not throw exceptions.
12 RUN: llvm-bolt %t -o %t.bolt --data %t.fdata --reorder-blocks=ext-tsp \
13 RUN: --split-functions --split-eh --print-after-lowering \
14 RUN: --print-only=main 2>&1 | FileCheck %s
16 ## All calls to printf() should be from exception handling code that was
17 ## recorded as cold during the profile collection run. Check that the calls
18 ## are placed after the split point.
20 CHECK: HOT-COLD SPLIT POINT
23 ## Verify the output still executes correctly when the exception path is being
25 RUN: %t.bolt arg1 arg2 arg3 2>&1 | FileCheck --check-prefix=CHECK-BOLTED %s
28 CHECK-BOLTED-NEXT: catch 1