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