2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / eh / terminate1.C
blob43cc19eafcbf7fd272eaa967d249196ec867b51a
1 // PR c++/44127
3 // This is basically the same test as g++.eh/terminate1.C, but that one
4 // tests runtime behavior and this tests the assembly output.  The test
5 // should call terminate (because initializing the catch parm throws), but
6 // from the personality routine, not directly.
8 // { dg-final { scan-assembler-not "_ZSt9terminatev" } }
10 // Also there should only be two EH call sites: #0 for throw A() and #1 for
11 // _Unwind_Resume.  We don't want call site info for __cxa_end_catch, since
12 // ~A is trivial.
14 // { dg-final { scan-assembler-not "LEHB2" } }
16 struct A
18   A() { }
19   A (const A&) { throw 1; }
22 int main()
24   try
25     {
26       throw A();
27     }
28   catch (A) { }