* doc/extend.texi (Loop-Specific Pragmas): Document pragma GCC unroll.
[official-gcc.git] / gcc / testsuite / g++.dg / ext / mv3.C
blobec2aa1ffec234646d927b4b4b4fe9eb4f5f9ef4e
1 /* Test case to check if a call to a multiversioned function
2    is replaced with a direct call to the particular version when
3    the most specialized version's target attributes match the
4    caller.  
5   
6    In this program, foo is multiversioned but there is no default
7    function.  This is an error if the call has to go through a
8    dispatcher.  However, the call to foo in bar can be replaced
9    with a direct call to the popcnt version of foo.  Hence, this
10    test should pass.  */
12 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
13 /* { dg-options "-O2" } */
16 int __attribute__ ((target ("sse")))
17 foo ()
19   return 1;
21 int __attribute__ ((target ("popcnt")))
22 foo ()
24   return 0;
27 int __attribute__ ((target ("popcnt")))
28 bar ()
30   return foo ();
33 int main ()
35   return bar ();