1 /* Test case to check if the compiler generates an error message
2 when the default version of a multiversioned function is absent
3 and its pointer is taken. */
4
5 /* { dg-do compile } */
6 /* { dg-require-ifunc "" } */
7 /* { dg-options "-O2" } */
8
9 int __attribute__ ((target ("sse")))
foo()10 foo ()
11 {
12 return 1;
13 }
14 int __attribute__ ((target ("popcnt")))
foo()15 foo ()
16 {
17 return 0;
18 }
19
main()20 int main ()
21 {
22 int (*p)() = &foo; /* { dg-error "use of multiversioned function without a default" {} } */
23 return (*p)();
24 }
25