[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / externc-ifunc-resolver.cpp
blob70c21b0ac7f9b53110ffcf101e9eaf168cb5b685
1 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
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
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}}