OSDN Git Service

PR c++/46538
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / eh / builtin1.C
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 struct A { A (); ~A (); int i; };
10
11 int
12 foo ()
13 {
14   A a;
15   printf ("foo %d\n", a.i);
16 }
17
18 int
19 bar ()
20 {
21   A a;
22   __builtin_printf ("foo %d\n", a.i);
23 }
24
25 /* { dg-final { scan-tree-dump-times "resx" 2 "eh" } } */
26 /* { dg-final { cleanup-tree-dump "eh" } } */