From 3d47402f2e8701c7ed340884720cc99727bd7f85 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 14 Nov 2013 13:58:06 +0000 Subject: Error if we see an alias to a declaration. In ELF and COFF an alias is just another offset in a section. There is no way to represent an alias to something in another file. In MachO, the spec has the N_INDR type which should allow for exactly that, but is not currently implemented. Given that it is specified but not implemented, we error in codegen to avoid miscompiling but don't reject aliases to declarations in the verifier to leave the option open of implementing it. In the past we have used alias to declarations as a way of implementing weakref, which is why it exists in some old tests which this patch updates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194705 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/alias-error.ll | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/CodeGen/X86/alias-error.ll (limited to 'test/CodeGen/X86/alias-error.ll') diff --git a/test/CodeGen/X86/alias-error.ll b/test/CodeGen/X86/alias-error.ll new file mode 100644 index 0000000000..89b0876a83 --- /dev/null +++ b/test/CodeGen/X86/alias-error.ll @@ -0,0 +1,5 @@ +; RUN: not llc < %s -mtriple=i686-pc-linux-gnu %s 2>&1 | FileCheck %s + +@a = external global i32 +@b = alias i32* @a +; CHECK: b: Target doesn't support aliases to declarations -- cgit v1.2.3