c++: prev declared hidden tmpl friend inst [PR112288]
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-pta-19.c
blobae47cb053b2d9c594323d8f1c785e985a588ef47
1 /* { dg-do run } */
2 /* { dg-require-ifunc "" } */
3 /* { dg-options "-O2 -fipa-pta" } */
5 #include <stdlib.h>
6 #include <stdbool.h>
8 #define hot __attribute__((hot))
10 static hot void multiver_default(unsigned int in, bool *ret)
12 if ( in & 1 ) {
13 *ret = false;
14 }else{
15 *ret = true;
19 static void (*resolve_multiver(void))(unsigned int in, bool *out)
21 return &multiver_default;
24 __attribute__ ((ifunc("resolve_multiver")))
25 static void multiver_test(unsigned int val, bool *ret);
27 static hot bool do_test(unsigned int val)
29 bool ret = false;
31 multiver_test(val, &ret);
33 return (ret == !(val & 0x1));
36 volatile unsigned int x = 2;
37 int main()
39 int i;
40 for(i = 1; i < x; i++) {
41 unsigned int val = x;
42 if ( !do_test(val) )
43 abort ();
45 return 0;