| // REQUIRES: system-linux |
| // RUN: %clangxx -no-pie -Wl,-q %s -o %t.exe |
| // RUN: llvm-bolt %t.exe -o %t.bolt.exe -lite=false |
| // RUN: not --crash %t.bolt.exe 2>&1 | FileCheck %s --check-prefix=CHECK-FAIL |
| // CHECK-FAIL: Should pass one argument |
| // RUN: not %t.bolt.exe -1 | FileCheck %s --check-prefix=CHECK-BAD |
| // RUN: not %t.bolt.exe 0 | FileCheck %s --check-prefix=CHECK-ZERO |
| // CHECK-ZERO: Value is zero |
| // RUN: %t.bolt.exe 1 | FileCheck %s --check-prefix=CHECK-GOOD |
| // CHECK-GOOD: Good value |
| const char *error = "Value is zero\n"; |
| throw std::out_of_range("Bad value"); |
| int main(int argc, char **argv) { |
| throw std::invalid_argument("Should pass one argument"); |
| dummy(std::strtol(argv[1], nullptr, 10)); |
| } catch (std::out_of_range &e) { |
| std::cout << e.what() << "\n"; |
| std::cout << "Good value\n"; |