xref: /minix3/external/bsd/llvm/dist/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/cg.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -S -emit-llvm -std=c++11 -include %S/ser.h %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -emit-pch -o %t-ser.pch -std=c++11 -x c++ %S/ser.h
3 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple x86_64-apple-darwin10 -S -emit-llvm -std=c++11 -include-pch %t-ser.pch %s -o - | FileCheck %s
4 
5 struct D {
6   ~D() throw();
7 };
8 struct E {
9   ~E() throw();
10 };
11 
test()12 void test() {
13   bool b;
14   // CHECK: store i8 1
15   b = noexcept(0);
16   // CHECK: store i8 0
17   b = noexcept(throw 0);
18   b = f1();
19   b = f2();
20 
21   // CHECK-NOT: call void @_ZN1ED1Ev
22   // CHECK: call void @_ZN1DD1Ev
23   D(), noexcept(E());
24 }
25 // CHECK: ret i1 true
26 // CHECK: ret i1 false
27