Test CXXNoexceptExpr codegen and serialization.

llvm-svn: 113630
This commit is contained in:
Sebastian Redl 2010-09-10 21:04:03 +00:00
parent b67655fc6d
commit 8c40ba392c
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,15 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S -emit-llvm -std=c++0x -include %S/ser.h %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-pch -o %t-ser.pch -std=c++0x -x c++ %S/ser.h
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -S -emit-llvm -std=c++0x -include-pch %t-ser.pch %s -o - | FileCheck %s
void test() {
bool b;
// CHECK: store i8 1, i8* %b, align 1
b = noexcept(0);
// CHECK: store i8 0, i8* %b, align 1
b = noexcept(throw 0);
// CHECK: ret i1 true
b = f1();
// CHECK: ret i1 false
b = f2();
}

View File

@ -0,0 +1,8 @@
// Serialization testing helper for noexcept, included by cg.cpp.
inline bool f1() {
return noexcept(0);
}
inline bool f2() {
return noexcept(throw 0);
}