comparison gcc/testsuite/g++.dg/ext/attr-noreturn-2.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* PR c++/83871 - wrong code for attribute const and pure on distinct
2 template specializations
3 Test to verify that attributes noreturn on multiple declarations of
4 the same function are merged.
5 { dg-do compile }
6 { dg-options "-O -fdump-tree-optimized" } */
7
8 int __attribute__ ((noreturn)) fnoreturn ();
9
10 void fnoreturn_failed ();
11
12 int test_noreturn () throw ()
13 {
14 fnoreturn ();
15 fnoreturn_failed ();
16 // Verify that the call to fnoreturn_failed() is eliminated.
17 // { dg-final { scan-tree-dump-not "fnoreturn_failed" "optimized" } }
18
19 // Expect no -Wreturn-type warning despite the absence of a return
20 // statement in a non-void function.
21 }
22
23
24 int __attribute__ ((noreturn)) fnoreturn_none ();
25 int fnoreturn_none ();
26
27 void fnoreturn_none_failed ();
28
29
30 int test_noreturn_none ()
31 {
32 fnoreturn_none ();
33 fnoreturn_none_failed ();
34 // { dg-final { scan-tree-dump-not "fnoreturn_none_failed" "optimized" } }
35 }
36
37 int fnone_noreturn ();
38 int __attribute__ ((noreturn)) fnone_noreturn ();
39
40 void fnone_noreturn_failed ();
41
42 int test_none_noreturn () throw ()
43 {
44 fnone_noreturn ();
45 fnone_noreturn_failed ();
46 // { dg-final { scan-tree-dump-not "fnone_noreturn_failed" "optimized" } }
47 }