blob: 5c1029f1a3ff5cf9cb843b135f50fa4355bcb024 [file] [log] [blame]
Richard Smith9ca5c422011-10-13 22:29:44 +00001// 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
Sebastian Redl8c40ba32010-09-10 21:04:03 +00004
Sebastian Redle56be2f72010-09-10 21:57:27 +00005struct D {
6 ~D() throw();
7};
8struct E {
9 ~E() throw();
10};
11
Sebastian Redl8c40ba32010-09-10 21:04:03 +000012void test() {
13 bool b;
Sebastian Redlb8a76c42010-09-10 22:34:40 +000014 // CHECK: store i8 1
Sebastian Redl8c40ba32010-09-10 21:04:03 +000015 b = noexcept(0);
Sebastian Redlb8a76c42010-09-10 22:34:40 +000016 // CHECK: store i8 0
Sebastian Redl8c40ba32010-09-10 21:04:03 +000017 b = noexcept(throw 0);
Sebastian Redl8c40ba32010-09-10 21:04:03 +000018 b = f1();
Sebastian Redl8c40ba32010-09-10 21:04:03 +000019 b = f2();
Sebastian Redle56be2f72010-09-10 21:57:27 +000020
21 // CHECK-NOT: call void @_ZN1ED1Ev
22 // CHECK: call void @_ZN1DD1Ev
23 D(), noexcept(E());
Sebastian Redl8c40ba32010-09-10 21:04:03 +000024}
Sebastian Redle56be2f72010-09-10 21:57:27 +000025// CHECK: ret i1 true
26// CHECK: ret i1 false