gcc/testsuite/g++.target/i386/mv12.C
raw| 1 | // Test case to check if multiversioning works as expected when the versions |
| 2 | // are defined in different files. |
| 3 | |
| 4 | // { dg-do run } |
| 5 | // { dg-require-ifunc "" } |
| 6 | // { dg-options "-O2" } |
| 7 | // { dg-additional-sources "mv12-aux.cc" } |
| 8 | |
| 9 | #include "mv12.h" |
| 10 | |
| 11 | int main () |
| 12 | { |
| 13 | if (__builtin_cpu_supports ("sse4.2")) |
| 14 | return foo () - 1; |
| 15 | return foo (); |
| 16 | } |
| 17 | |
| 18 | __attribute__ ((target ("default"))) |
| 19 | int foo () |
| 20 | { |
| 21 | return 0; |
| 22 | } |