Debian Codegraph @

gcc/testsuite/g++.dg/eh/builtin2.C

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