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/Feature | |
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/Feature')
-rw-r--r-- | test/Feature/aliases.ll | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/Feature/aliases.ll b/test/Feature/aliases.ll index 139381215e..7ffa5f2601 100644 --- a/test/Feature/aliases.ll +++ b/test/Feature/aliases.ll @@ -4,14 +4,16 @@ @llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @foo1 to i8*)], section "llvm.metadata" -@bar = external global i32 +@bar = global i32 0 @foo1 = alias i32* @bar @foo2 = alias i32* @bar @foo3 = alias i32* @foo2 %FunTy = type i32() -declare i32 @foo_f() +define i32 @foo_f() { + ret i32 0 +} @bar_f = alias weak %FunTy* @foo_f @bar_ff = alias i32()* @bar_f |