2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / g++.dg / eh / builtin1.C
blob1f56d1a833dd3e17cb8d3731617de395c570ecd8
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 struct A { A (); ~A (); int i; };
11 int
12 foo ()
14   A a;
15   printf ("foo %d\n", a.i);
18 int
19 bar ()
21   A a;
22   __builtin_printf ("foo %d\n", a.i);
25 /* { dg-final { scan-tree-dump-times "resx 1" 2 "eh" } } */
26 /* { dg-final { cleanup-tree-dump "eh" } } */