1 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s 2 3 extern "C" { 4 __attribute__((used)) static void *resolve_foo() { return 0; } 5 namespace NS { 6 __attribute__((used)) static void *resolve_foo() { return 0; } 7 } // namespace NS 8 9 // FIXME: This diagnostic is pretty confusing, the issue is that the existence 10 // of the two functions suppresses the 'alias' creation, and thus the ifunc 11 // resolution via the alias as well. In the future we should probably find 12 // some way to improve this diagnostic (likely by diagnosing when we decide 13 // this case suppresses alias creation). 14 __attribute__((ifunc("resolve_foo"))) void foo(); // expected-error{{ifunc must point to a defined function}} 15 } 16 17