aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ext/mv6.C
blob: 2273065996b849e13c7dbe164cad3d0a5f2f90ec (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
/* Test to check if member version multiversioning works correctly.  */

/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-require-ifunc "" }  */
/* { dg-options "-march=x86-64" } */

class Foo
{
 public:
  /* Default version of foo.  */
  __attribute__ ((target("default")))
  int foo ()
  {
    return 0;
  }
  /* corei7 version of foo.  */
  __attribute__ ((target("arch=corei7")))
  int foo ()
  {
    return 0;
  }
};

int main ()
{
  Foo f;
  return f.foo ();
}