Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / g++.dg / eh / builtin2.C
blobb106516da683866ff3692779346c69cf46de8f52
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" }
6 extern "C" int printf (const char *, ...) throw();
8 struct A { A (); ~A (); int i; };
10 int
11 foo ()
13   A a;
14   printf ("foo %d\n", a.i);
17 int
18 bar ()
20   A a;
21   __builtin_printf ("foo %d\n", a.i);
24 /* { dg-final { scan-tree-dump-times "resx 1" 0 "eh" } } */
25 /* { dg-final { cleanup-tree-dump "eh" } } */