aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/mvc11.c
blob: 5bd10f4651d6cde7beaa9ef5c458495dba6e9ee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-do run } */
/* { dg-require-ifunc "" } */
/* { dg-options "-std=gnu99" } */

__attribute__((noipa)) int 
baz (int (*fn) (void))
{
  asm volatile ("" : "+g" (fn) : : "memory");
  return fn ();
}

__attribute__((target_clones("arch=sandybridge", "default"))) static int
bar (void)
{
  return 1;
}

__attribute__((target_clones("arch=sandybridge", "default"))) int
foo (void)
{
  baz (bar) - 1;
}

int
main ()
{
  foo ();
}