annotate gcc/testsuite/obj-c++.dg/fobjc-exceptions-3.mm @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test that Objective-C exceptions cause an error with -fobjc-exceptions. */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 @class Object;
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 int dummy (int number, Object *o)
kono
parents:
diff changeset
7 {
kono
parents:
diff changeset
8 @throw o; /* { dg-error ".-fobjc-exceptions. is required to enable Objective-C exception syntax" } */
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 @try { /* Nothing, error has already been produced. */
kono
parents:
diff changeset
11 number++;
kono
parents:
diff changeset
12 @throw o; /* Nothing, error has already been produced. */
kono
parents:
diff changeset
13 }
kono
parents:
diff changeset
14 @catch (id object)
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 number++;
kono
parents:
diff changeset
17 @throw; /* Nothing, error has already been produced. */
kono
parents:
diff changeset
18 }
kono
parents:
diff changeset
19 @finally
kono
parents:
diff changeset
20 {
kono
parents:
diff changeset
21 number++;
kono
parents:
diff changeset
22 }
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 @synchronized (o) /* Nothing, error has already been produced. */
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 number++;
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 return number;
kono
parents:
diff changeset
30 }