[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / eh / builtin1.C
blob2d04d9c08e8f0b8bab6cca6be5301009b040ed75
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" }
7 extern "C" int printf (const char *, ...);
9 extern void callme (void) throw();
11 void
12 foo (int i)
14   try {
15     printf ("foo %d\n", i);
16   } catch (...) {
17     callme();
18   }
21 void
22 bar (int i)
24   try {
25     __builtin_printf ("foo %d\n", i);
26   } catch (...) {
27     callme();
28   }
31 /* { dg-final { scan-tree-dump-times "resx" 2 "eh" } } */