summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/arc-with-atthrow.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-07-20 23:39:56 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-07-20 23:39:56 +0000
commit517695b27c747c345c07224f091ee45fe2a3724d (patch)
tree6fe19934c19b2f64c603a034aeb11d0cdbaca616 /clang/test/CodeGenObjC/arc-with-atthrow.m
parent72c4af5d66c5a6140028e106785c01ac1c8aafe4 (diff)
downloadbcm5719-llvm-517695b27c747c345c07224f091ee45fe2a3724d.tar.gz
bcm5719-llvm-517695b27c747c345c07224f091ee45fe2a3724d.zip
objc-arc: Fixes a crash @throw'ing an objc message.
// pr10411 llvm-svn: 135638
Diffstat (limited to 'clang/test/CodeGenObjC/arc-with-atthrow.m')
-rw-r--r--clang/test/CodeGenObjC/arc-with-atthrow.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/arc-with-atthrow.m b/clang/test/CodeGenObjC/arc-with-atthrow.m
new file mode 100644
index 00000000000..b076879bdd3
--- /dev/null
+++ b/clang/test/CodeGenObjC/arc-with-atthrow.m
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-nonfragile-abi -fobjc-exceptions -o - %s | FileCheck %s
+// $CLANG -cc1 -fobjc-arc -fobjc-nonfragile-abi -fobjc-exceptions
+// pr10411
+
+@interface NSException
++ (id)exception;
+@end
+
+void test()
+{
+ @throw [NSException exception];
+}
+
+// CHECK: objc_retainAutoreleasedReturnValue
+// CHECK: call void @objc_release
+// CHECK: call void @objc_exception_throw
OpenPOWER on IntegriCloud