Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / torture / pr90994.C
blob8feb36f2361c5b2c653d44abc6e14ed88f7c748b
1 // { dg-do compile }
2 // { dg-additional-options "-fnon-call-exceptions -Wuninitialized" }
4 extern void printval(unsigned char v);
6 inline int readbyte(unsigned char *__restrict presult,
7                     unsigned char volatile *ptr)
9   unsigned char v;
10   try {
11       v = *ptr;
12   } catch (...) {
13       return -1;
14   }
15   *presult = v;
16   return 0;
19 int incorrectWarning(unsigned char volatile *ptr)
21   int error;
22   unsigned char first;
23   unsigned char second;
25   error = readbyte(&first, ptr);
26   asm("\n\n\n\n\n" : : "X" (error != 0));
27   if (error != 0)
28     goto err;
30   error = readbyte(&second, ptr);
31   if (error != 0)
32     goto err;
34   printval(first);   // { dg-bogus "uninitialized" }
35   printval(second);
36   return 0;
38 err:
39   return error;