diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-03-12 20:15:49 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-03-12 20:15:49 +0000 |
commit | 38048cdb1c016e1429004ddf4adfa40a8d853cbf (patch) | |
tree | 20868c4f3015e4cc37f7d41e0312d85e50cf2d02 /test/Verifier | |
parent | 4207c6759c040ca9c26fd305b1e62d5c68a44fb1 (diff) | |
download | llvm-38048cdb1c016e1429004ddf4adfa40a8d853cbf.tar.gz llvm-38048cdb1c016e1429004ddf4adfa40a8d853cbf.tar.bz2 llvm-38048cdb1c016e1429004ddf4adfa40a8d853cbf.tar.xz |
Reject alias to undefined symbols in the verifier.
On ELF and COFF an alias is just another name for a position in the file.
There is no way to refer to a position in another file, so an alias to
undefined is meaningless.
MachO currently doesn't support aliases. The spec has a N_INDR, which when
implemented will have a different set of restrictions. Adding support for
it shouldn't be harder than any other IR extension.
For now, having the IR represent what is actually possible with current
tools makes it easier to fix the design of GlobalAlias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier')
-rw-r--r-- | test/Verifier/alias.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Verifier/alias.ll b/test/Verifier/alias.ll new file mode 100644 index 0000000000..e3636bc701 --- /dev/null +++ b/test/Verifier/alias.ll @@ -0,0 +1,12 @@ +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s + + +declare void @f() +@fa = alias void ()* @f +; CHECK: Alias must point to a definition +; CHECK-NEXT: @fa + +@g = external global i32 +@ga = alias i32* @g +; CHECK: Alias must point to a definition +; CHECK-NEXT: @ga |