r209228 - GlobalValue: Testcase for hidden visibility and local linkage
Duncan P. N. Exon Smith
dexonsmith at apple.com
Tue May 20 12:04:31 PDT 2014
Author: dexonsmith
Date: Tue May 20 14:04:31 2014
New Revision: 209228
URL: http://llvm.org/viewvc/llvm-project?rev=209228&view=rev
Log:
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
Added:
cfe/trunk/test/CodeGen/hidden-alias-to-internal-function.c
Added: cfe/trunk/test/CodeGen/hidden-alias-to-internal-function.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/hidden-alias-to-internal-function.c?rev=209228&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/hidden-alias-to-internal-function.c (added)
+++ cfe/trunk/test/CodeGen/hidden-alias-to-internal-function.c Tue May 20 14:04:31 2014
@@ -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()
More information about the cfe-commits
mailing list