UseListOrder: Don't give constant IDs to GlobalValues

Since initializers of GlobalValues are being assigned IDs before
GlobalValues themselves, explicitly exclude GlobalValues from the
constant pool.  Added targeted test in `test/Bitcode/use-list-order.ll`
and added two more RUN lines in `test/Assembly`.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214368 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2014-07-31 00:13:28 +00:00
parent dc6c25c9ee
commit e5ae09b08f
4 changed files with 21 additions and 3 deletions

View File

@ -22,6 +22,19 @@
@globalAndFunction = global i4 4
@globalAndFunctionGlobalUser = global i4* @globalAndFunction
; Check use-list order for constants used by globals that are themselves used
; as aliases. This confirms that this globals are recognized as GlobalValues
; (not general constants).
@const.global = global i63 0
@const.global.ptr = global i63* @const.global
@const.global.2 = global i63 0
; Same as above, but for aliases.
@const.target = global i62 1
@const.alias = alias i62* @const.target
@const.alias.ptr = alias i62* @const.alias
@const.alias.2 = alias i62* @const.target
define i64 @f(i64 %f) {
entry:
%sum = add i64 %f, 0