| 1 |
// Verify that if explicit prototype for builtin is present without throw(), |
| 2 |
// both the normal builtin and __builtin_* variant are expected to be |
| 3 |
// able to throw exceptions. |
| 4 |
// { dg-do compile } |
| 5 |
// { dg-options "-fdump-tree-eh" } |
| 6 |
|
| 7 |
extern "C" int printf (const char *, ...); |
| 8 |
|
| 9 |
extern void callme (void) throw(); |
| 10 |
|
| 11 |
void |
| 12 |
foo (int i) |
| 13 |
{ |
| 14 |
try { |
| 15 |
printf ("foo %d\n", i); |
| 16 |
} catch (...) { |
| 17 |
callme(); |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
void |
| 22 |
bar (int i) |
| 23 |
{ |
| 24 |
try { |
| 25 |
__builtin_printf ("foo %d\n", i); |
| 26 |
} catch (...) { |
| 27 |
callme(); |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
/* { dg-final { scan-tree-dump-times "resx" 2 "eh" } } */ |