Richard Smith | 9ca5c42 | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 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 |
Sebastian Redl | 8c40ba3 | 2010-09-10 21:04:03 +0000 | [diff] [blame] | 4 | |
Sebastian Redl | e56be2f7 | 2010-09-10 21:57:27 +0000 | [diff] [blame] | 5 | struct D { |
| 6 | ~D() throw(); |
| 7 | }; |
| 8 | struct E { |
| 9 | ~E() throw(); |
| 10 | }; |
| 11 | |
Sebastian Redl | 8c40ba3 | 2010-09-10 21:04:03 +0000 | [diff] [blame] | 12 | void test() { |
| 13 | bool b; |
Sebastian Redl | b8a76c4 | 2010-09-10 22:34:40 +0000 | [diff] [blame] | 14 | // CHECK: store i8 1 |
Sebastian Redl | 8c40ba3 | 2010-09-10 21:04:03 +0000 | [diff] [blame] | 15 | b = noexcept(0); |
Sebastian Redl | b8a76c4 | 2010-09-10 22:34:40 +0000 | [diff] [blame] | 16 | // CHECK: store i8 0 |
Sebastian Redl | 8c40ba3 | 2010-09-10 21:04:03 +0000 | [diff] [blame] | 17 | b = noexcept(throw 0); |
Sebastian Redl | 8c40ba3 | 2010-09-10 21:04:03 +0000 | [diff] [blame] | 18 | b = f1(); |
Sebastian Redl | 8c40ba3 | 2010-09-10 21:04:03 +0000 | [diff] [blame] | 19 | b = f2(); |
Sebastian Redl | e56be2f7 | 2010-09-10 21:57:27 +0000 | [diff] [blame] | 20 | |
| 21 | // CHECK-NOT: call void @_ZN1ED1Ev |
| 22 | // CHECK: call void @_ZN1DD1Ev |
| 23 | D(), noexcept(E()); |
Sebastian Redl | 8c40ba3 | 2010-09-10 21:04:03 +0000 | [diff] [blame] | 24 | } |
Sebastian Redl | e56be2f7 | 2010-09-10 21:57:27 +0000 | [diff] [blame] | 25 | // CHECK: ret i1 true |
| 26 | // CHECK: ret i1 false |