* objc.dg/fobjc-exceptions.m: New test.
From-SVN: r164152
This commit is contained in:
parent
3dac89f7df
commit
1c732eb722
|
@ -1,3 +1,7 @@
|
|||
2010-09-10 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* objc.dg/fobjc-exceptions.m: New test.
|
||||
|
||||
2010-09-10 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* g++.dg/inherit/covariant7.C: Fix pattern matching.
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/* Test that Objective-C exceptions cause an error with -fobjc-exceptions. */
|
||||
/* { dg-do compile } */
|
||||
|
||||
@class Object;
|
||||
|
||||
int dummy (int number, Object *o)
|
||||
{
|
||||
@try { /* { dg-error "fobjc-exceptions" "is required to enable Objective-C exception syntax" } */
|
||||
number++;
|
||||
@throw o; /* { dg-error "fobjc-exceptions" "is required to enable Objective-C exception syntax" } */
|
||||
}
|
||||
@catch (id object)
|
||||
{
|
||||
number++;
|
||||
@throw; /* { dg-error "fobjc-exceptions" "is required to enable Objective-C exception syntax" } */
|
||||
}
|
||||
@finally
|
||||
{
|
||||
number++;
|
||||
}
|
||||
|
||||
@synchronized (o) /* { dg-error "fobjc-exceptions" "is required to enable Objective-C exception syntax" } */
|
||||
{
|
||||
number++;
|
||||
}
|
||||
|
||||
return number;
|
||||
}
|
||||
|
Loading…
Reference in New Issue