2015-03-04 03:21:04 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTRY | FileCheck %s -check-prefix=TRY
|
2015-03-04 02:36:38 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTHROW | FileCheck %s -check-prefix=THROW
|
2014-05-06 05:12:12 +08:00
|
|
|
|
|
|
|
void external();
|
|
|
|
|
|
|
|
inline void not_emitted() {
|
|
|
|
throw int(13); // no error
|
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int rv = 0;
|
|
|
|
#ifdef TRY
|
2015-02-26 07:01:21 +08:00
|
|
|
try {
|
|
|
|
external(); // TRY: invoke void @"\01?external@@YAXXZ"
|
2014-05-06 05:12:12 +08:00
|
|
|
} catch (int) {
|
|
|
|
rv = 1;
|
2015-03-04 03:21:04 +08:00
|
|
|
// TRY: call void @llvm.eh.begincatch(i8* %{{.*}}, i8* %{{.*}})
|
|
|
|
// TRY: call void @llvm.eh.endcatch()
|
2014-05-06 05:12:12 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef THROW
|
2015-02-26 07:01:21 +08:00
|
|
|
// THROW: call void @"\01?terminate@@YAXXZ"
|
|
|
|
throw int(42);
|
2014-05-06 05:12:12 +08:00
|
|
|
#endif
|
|
|
|
return rv;
|
|
|
|
}
|