view gcc/testsuite/g++.target/i386/mv4.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

/* Test case to check if the compiler generates an error message
   when the default version of a multiversioned function is absent
   and its pointer is taken.  */

/* { dg-do compile } */
/* { dg-require-ifunc "" }  */
/* { dg-options "-O2" } */

int __attribute__ ((target ("sse")))
foo ()
{
  return 1;
}
int __attribute__ ((target ("popcnt")))
foo ()
{
  return 0;
}

int main ()
{
  int (*p)() = &foo; /* { dg-error "use of multiversioned function without a default" {} } */
  return (*p)();
}