| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-ifunc "" } */ |
| 3 |
/* { dg-options "-O0" } */ |
| 4 |
/* { dg-additional-options "-Wno-experimental-fmv-target" } */ |
| 5 |
|
| 6 |
__attribute__((target_version("default"))) |
| 7 |
int foo (); |
| 8 |
|
| 9 |
__attribute__((target_version("dotprod"))) |
| 10 |
int foo () |
| 11 |
{ |
| 12 |
return 3; |
| 13 |
} |
| 14 |
__attribute__((target_version("sve+sve2"))) |
| 15 |
int foo () |
| 16 |
{ |
| 17 |
return 5; |
| 18 |
} |
| 19 |
|
| 20 |
__attribute__((target_version("default"))) |
| 21 |
int foo (int); |
| 22 |
|
| 23 |
__attribute__((target_version("dotprod"))) |
| 24 |
int foo (int) |
| 25 |
{ |
| 26 |
return 4; |
| 27 |
} |
| 28 |
|
| 29 |
__attribute__((target_version("sve+sve2"))) |
| 30 |
int foo (int) |
| 31 |
{ |
| 32 |
return 6; |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
int bar() |
| 37 |
{ |
| 38 |
return foo (); |
| 39 |
} |
| 40 |
|
| 41 |
/* When updating any of the symbol names in these tests, make sure to also |
| 42 |
update any tests for their absence in mvc-symbolsN.C */ |
| 43 |
|
| 44 |
/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */ |
| 45 |
/* { dg-final { scan-assembler-times "\n_Z3foov\._Mdotprod:\n" 1 } } */ |
| 46 |
/* { dg-final { scan-assembler-times "\n_Z3foov\._MsveMsve2:\n" 1 } } */ |
| 47 |
/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */ |
| 48 |
/* { dg-final { scan-assembler-times "\n\tbl\t_Z3foov\n" 1 } } */ |
| 49 |
/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, %gnu_indirect_function\n" 1 } } */ |
| 50 |
/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */ |
| 51 |
|
| 52 |
/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 0 } } */ |
| 53 |
/* { dg-final { scan-assembler-times "\n_Z3fooi\._Mdotprod:\n" 1 } } */ |
| 54 |
/* { dg-final { scan-assembler-times "\n_Z3fooi\._MsveMsve2:\n" 1 } } */ |
| 55 |
/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */ |
| 56 |
/* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, %gnu_indirect_function\n" 0 } } */ |
| 57 |
/* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 0 } } */ |