2012-06-20 14:18:46 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fobjc-exceptions %s -o - | FileCheck %s
|
2009-12-15 05:35:01 +08:00
|
|
|
|
2009-12-15 06:17:35 +08:00
|
|
|
|
|
|
|
extern int printf(const char*, ...);
|
2009-12-15 05:35:01 +08:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
@try {
|
|
|
|
@throw @"foo";
|
|
|
|
} @catch (id e) {
|
|
|
|
@try {
|
|
|
|
// CHECK: call void @objc_exception_throw
|
|
|
|
@throw;
|
|
|
|
} @catch (id e) {
|
|
|
|
if (e) {
|
|
|
|
printf("caught \n");
|
|
|
|
} else {
|
|
|
|
printf("caught (WRONG)\n");
|
|
|
|
}
|
|
|
|
} @catch (...) {
|
|
|
|
printf("caught nothing (WRONG)\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|