llvm-6502/test/Bitcode
Duncan P. N. Exon Smith 49135bb76c Don't upgrade global constructors when reading bitcode
An optional third field was added to `llvm.global_ctors` (and
`llvm.global_dtors`) in r209015.  Most of the code has been changed to
deal with both versions of the variables.  Users of the C API might
create either version, the helper functions in LLVM create the two-field
version, and clang now creates the three-field version.

However, the BitcodeReader was changed to always upgrade to the
three-field version.  This created an unnecessary inconsistency in the
IR before/after serializing to bitcode.

This commit resolves the inconsistency by making the third field truly
optional (and not upgrading in the bitcode reader).  Since `llvm-link`
was relying on this upgrade code, rather than deleting it I've moved it
into `ModuleLinker`, where it upgrades these arrays as necessary to
resolve inconsistencies between modules.

The ideal resolution would be to remove the 2-field version and make the
third field required.  I filed PR20506 to track that.

I changed `test/Bitcode/upgrade-global-ctors.ll` to a negative test and
duplicated the `llvm-link` check in `test/Linker/global_ctors.ll` to
check both upgrade directions.

Since I came across this as part of PR5680 (serializing use-list order),
I've also added the missing `verify-uselistorder` RUN line to
`test/Bitcode/metadata-2.ll`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215457 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 16:46:37 +00:00
..
2006-12-11-Cast-ConstExpr.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
2009-06-11-FirstClassAggregateConstant.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
aggregateInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
aggregateInstructions.3.2.ll.bc
arm32_neon_vcnt_upgrade.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
atomic.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
attributes-3.3.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
attributes-3.3.ll.bc
attributes.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
binaryFloatInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
binaryFloatInstructions.3.2.ll.bc
binaryIntInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
binaryIntInstructions.3.2.ll.bc
bitwiseInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
bitwiseInstructions.3.2.ll.bc
blockaddress.ll UseListOrder: Fix blockaddress use-list order 2014-08-01 22:27:19 +00:00
calling-conventions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
calling-conventions.3.2.ll.bc
case-ranges-3.3.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
case-ranges-3.3.ll.bc
cmpxchg-upgrade.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
cmpxchg-upgrade.ll.bc
conversionInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
conversionInstructions.3.2.ll.bc
drop-debug-info.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
extractelement.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
flags.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
function-encoding-rel-operands.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
global-variables.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
global-variables.3.2.ll.bc
inalloca.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
invalid.ll
invalid.ll.bc
linkage-types-3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
linkage-types-3.2.ll.bc
local-linkage-default-visibility.3.4.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
local-linkage-default-visibility.3.4.ll.bc
memInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
memInstructions.3.2.ll.bc
metadata-2.ll Don't upgrade global constructors when reading bitcode 2014-08-12 16:46:37 +00:00
metadata.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
miscInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
miscInstructions.3.2.ll.bc
null-type.ll
null-type.ll.bc
old-aliases.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
old-aliases.ll.bc
pr18704.ll
pr18704.ll.bc
ptest-new.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
ptest-old.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
select.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
shuffle.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
ssse3_palignr.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
tailcall.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
terminatorInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
terminatorInstructions.3.2.ll.bc
upgrade-global-ctors.ll Don't upgrade global constructors when reading bitcode 2014-08-12 16:46:37 +00:00
upgrade-global-ctors.ll.bc
upgrade-loop-metadata.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
upgrade-loop-metadata.ll.bc
upgrade-tbaa.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
use-list-order.ll UseListOrder: Fix blockaddress use-list order 2014-08-01 22:27:19 +00:00
variableArgumentIntrinsic.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
variableArgumentIntrinsic.3.2.ll.bc
vectorInstructions.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
vectorInstructions.3.2.ll.bc
visibility-styles.3.2.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
visibility-styles.3.2.ll.bc
weak-cmpxchg-upgrade.ll verify-uselistorder: Change the default -num-shuffles=5 2014-07-31 18:46:24 +00:00
weak-cmpxchg-upgrade.ll.bc