diff options
author | Justin Holewinski <jholewinski@nvidia.com> | 2012-11-16 21:03:47 +0000 |
---|---|---|
committer | Justin Holewinski <jholewinski@nvidia.com> | 2012-11-16 21:03:47 +0000 |
commit | eaff2d55a988aa107ca6fe19e2220d8672770da5 (patch) | |
tree | 8f59a509b9bdaa2e6b84ad978ab0012af73d6d23 /test/Assembler/global-addrspace-forwardref.ll | |
parent | 4f0dfbb454ea8110459e2d1ee5f92e74cb3e8a5c (diff) |
Preserve address space of forward-referenced global variables in the LL parser
Before, the parser would assert on the following code:
@a2 = global i8 addrspace(1)* @a
@a = addrspace(1) global i8 0
because the type of @a was "i8*" instead of "i8 addrspace(1)*" when parsing
the initializer for @a2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Assembler/global-addrspace-forwardref.ll')
-rw-r--r-- | test/Assembler/global-addrspace-forwardref.ll | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Assembler/global-addrspace-forwardref.ll b/test/Assembler/global-addrspace-forwardref.ll new file mode 100644 index 0000000000..f0f094a224 --- /dev/null +++ b/test/Assembler/global-addrspace-forwardref.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +; Make sure the address space of forward decls is preserved + +; CHECK: @a2 = global i8 addrspace(1)* @a +; CHECK: @a = addrspace(1) global i8 0 +@a2 = global i8 addrspace(1)* @a +@a = addrspace(1) global i8 0 |