Debian Codegraph @

gcc/testsuite/g++.dg/ipa/pr92697.C

raw
1 /* { dg-do compile } */
2 /* { dg-require-ifunc "" } */
3 /* { dg-options "-O2 -fdump-ipa-sra" } */
4
5 extern int have_avx2;
6 extern int have_ssse3;
7
8 namespace NTL
9 {
10
11 static void randomstream_impl_init_base ()
12 {
13 __builtin_printf ("Frob1\n");
14 }
15
16 static void // __attribute__ ((target ("ssse3")))
17 randomstream_impl_init_ssse3 ()
18 {
19 __builtin_printf ("Frob2\n");
20 }
21
22 static void
23 //__attribute__ ((target ("avx2,fma,avx,pclmul,ssse3")))
24 randomstream_impl_init_avx2 ()
25 {
26 __builtin_printf ("Frob3\n");
27 }
28
29 extern "C"
30 {
31 static void (*resolve_randomstream_impl_init (void)) ()
32 {
33 if (have_avx2)
34 return &randomstream_impl_init_avx2;
35 if (have_ssse3)
36 return &randomstream_impl_init_ssse3;
37 return &randomstream_impl_init_base;
38 }
39 }
40 static void
41 __attribute__ ((ifunc ("resolve_" "randomstream_impl_init")))
42 randomstream_impl_init ();
43 void foo ()
44 {
45 randomstream_impl_init ();
46 }
47
48 }
49
50
51 /* { dg-final { scan-ipa-dump-not "Created new node" "sra" } } */