gcc/testsuite/g++.target/i386/mv6.C
raw| 1 | /* Test to check if member version multiversioning works correctly. */ |
| 2 | |
| 3 | /* { dg-do run } */ |
| 4 | /* { dg-require-ifunc "" } */ |
| 5 | /* { dg-options "-march=x86-64" } */ |
| 6 | |
| 7 | class Foo |
| 8 | { |
| 9 | public: |
| 10 | /* Default version of foo. */ |
| 11 | __attribute__ ((target("default"))) |
| 12 | int foo () |
| 13 | { |
| 14 | return 0; |
| 15 | } |
| 16 | /* corei7 version of foo. */ |
| 17 | __attribute__ ((target("arch=corei7"))) |
| 18 | int foo () |
| 19 | { |
| 20 | return 0; |
| 21 | } |
| 22 | }; |
| 23 | |
| 24 | int main () |
| 25 | { |
| 26 | Foo f; |
| 27 | return f.foo (); |
| 28 | } |