gcc/testsuite/gcc.target/i386/mvc11.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-require-ifunc "" } */ |
| 3 | /* { dg-options "-std=gnu99" } */ |
| 4 | |
| 5 | __attribute__((noipa)) int |
| 6 | baz (int (*fn) (void)) |
| 7 | { |
| 8 | asm volatile ("" : "+g" (fn) : : "memory"); |
| 9 | return fn (); |
| 10 | } |
| 11 | |
| 12 | __attribute__((target_clones("arch=sandybridge", "default"))) static int |
| 13 | bar (void) |
| 14 | { |
| 15 | return 1; |
| 16 | } |
| 17 | |
| 18 | __attribute__((target_clones("arch=sandybridge", "default"))) int |
| 19 | foo (void) |
| 20 | { |
| 21 | baz (bar) - 1; |
| 22 | } |
| 23 | |
| 24 | int |
| 25 | main () |
| 26 | { |
| 27 | foo (); |
| 28 | } |