summaryrefslogtreecommitdiff
path: root/bolt/test/runtime/exceptions-plt.cpp
blob: 3d8e7a5133e2c1f6fa2e5f9f26947347eb466a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Verify that PLT optimization in BOLT preserves exception-handling info.

// REQUIRES: system-linux

// RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
// Link against a DSO to ensure PLT entries.
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s %t.so -o %t.exe
// RUN: llvm-bolt %t.exe -o %t.bolt.exe --plt=all
// RUN: %t.bolt.exe

int main() {
  try {
    throw new int;
  } catch (...) {
    return 0;
  }
  return 1;
}