p9-noexcept.cpp 623 B

12345678910111213141516171819202122
  1. // RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s
  2. void external();
  3. void target() noexcept
  4. {
  5. // CHECK: invoke void @_Z8externalv()
  6. external();
  7. }
  8. // CHECK: [[T0:%.*]] = landingpad { i8*, i32 }
  9. // CHECK-NEXT: catch i8* null
  10. // CHECK-NEXT: [[T1:%.*]] = extractvalue { i8*, i32 } [[T0]], 0
  11. // CHECK-NEXT: call void @__clang_call_terminate(i8* [[T1]]) [[NR_NUW:#[0-9]+]]
  12. // CHECK-NEXT: unreachable
  13. void reverse() noexcept(false)
  14. {
  15. // CHECK: call void @_Z8externalv()
  16. external();
  17. }
  18. // CHECK: attributes [[NR_NUW]] = { noreturn nounwind }