From: Duncan P. N. Exon Smith Date: Tue, 20 May 2014 19:04:31 +0000 (+0000) Subject: GlobalValue: Testcase for hidden visibility and local linkage X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec6a7da7d4478151881f63a7a012bd23f5c6bc11;p=clang GlobalValue: Testcase for hidden visibility and local linkage This is a testcase for r209227, a change in LLVM that automatically sets visibility to default when the linkage is changed to local (rather than asserting). What this testcase triggers is hard to reproduce otherwise: the `GlobalValue` is created (with non-local linkage), the visibility is set to hidden, and then the linkage is set to local. PR19760 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209228 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/hidden-alias-to-internal-function.c b/test/CodeGen/hidden-alias-to-internal-function.c new file mode 100644 index 0000000000..37e37659d7 --- /dev/null +++ b/test/CodeGen/hidden-alias-to-internal-function.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -o - -x c %s +// Reproduce the crash in PR19760. +static void foo(void) {} +void bar(void) __attribute__((alias("foo"))) +__attribute__((visibility("hidden"))); + +// CHECK: @bar = hidden alias void ()* @foo +// CHECK: define internal void @foo()