2011-10-02 09:16:38 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -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");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|