1 /* PR c++/83871 - wrong code for attribute const and pure on distinct
2 template specializations
4 { dg-options "-O1 -Wall -fdump-tree-optimized" } */
6 int __attribute__ ((const)) fconst_none ();
9 void func_const_none_failed ();
11 void func_const_none ()
13 int i0 = fconst_none ();
14 int i1 = fconst_none ();
16 func_const_none_failed ();
18 // { dg-final { scan-tree-dump-not "func_const_none_failed" "optimized" } }
23 int __attribute__ ((const)) fnone_const ();
25 void func_none_const_failed ();
27 void func_none_const ()
29 int i0 = fnone_const ();
30 int i1 = fnone_const ();
32 func_none_const_failed ();
34 // { dg-final { scan-tree-dump-not "func_none_const_failed" "optimized" } }
38 int __attribute__ ((const)) fconst_none (T);
43 void templ_const_none_failed ();
45 void template_const_none ()
47 int i0 = fconst_none<int> (0);
48 int i1 = fconst_none<int> (0);
50 templ_const_none_failed ();
52 // { dg-final { scan-tree-dump-not "templ_const_none_failed" "optimized" } }
60 int __attribute__ ((const)) fnone_const (T);
62 void templ_none_const_failed ();
64 void test_fnone_const ()
66 int i0 = fnone_const<int> (0);
67 int i1 = fnone_const<int> (0);
69 templ_none_const_failed ();
71 // { dg-final { scan-tree-dump-not "templ_none_const_failed" "optimized" } }