OSDN Git Service

patch for PR rtl-optimization/25130
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / obj-c++.dg / try-catch-10.mm
1 /* Check that taking the address of a local variable marked 'volatile'
2    by the compiler does not generate untoward errors.  */
3 /* Developed by Ziemowit Laski <zlaski@apple.com>.  */
4
5 /* { dg-options "-fobjc-exceptions" } */
6 /* { dg-do compile } */
7
8
9 void foo (int *arg1, int *arg2)
10 {
11   *arg1 = *arg2;
12 }
13
14 void bar (int arg) {
15   int rcvr;
16
17   @try {
18     rcvr = arg;
19   }
20   @finally {
21     int *rcvr0 = &rcvr;
22     foo (rcvr0, &arg);
23   }
24 }
25