cg.cpp revision 762bb9d0ad20320b9f97a841dce57ba5e8e48b07
1cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// 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
2cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// 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
3cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// 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
4cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
5cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)struct D {
6cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  ~D() throw();
7cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)};
8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)struct E {
9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  ~E() throw();
10cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)};
11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
12cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)void test() {
13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  bool b;
14cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // CHECK: store i8 1
15cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  b = noexcept(0);
16cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // CHECK: store i8 0
17cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  b = noexcept(throw 0);
18cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  b = f1();
19cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  b = f2();
20cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
21cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // CHECK-NOT: call void @_ZN1ED1Ev
22cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // CHECK: call void @_ZN1DD1Ev
23cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  D(), noexcept(E());
24cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)}
25cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// CHECK: ret i1 true
26cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// CHECK: ret i1 false
27cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)