llvm-6502/test/tools/gold/Inputs/comdat.ll
Rafael Espindola 5f92811f30 Handle a symbol being undefined.
This can happen if:
* It is present in a comdat in one file.
* It is not present in the comdat of the file that is kept.
* Is is not used.

This should fix the LTO boostrap.

Thanks to Takumi NAKAMURA for setting up the bot!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225983 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-14 13:53:50 +00:00

26 lines
580 B
LLVM

$c2 = comdat any
$c1 = comdat any
; This is only present in this file. The linker will keep $c1 from the first
; file and this will be undefined.
@will_be_undefined = global i32 1, comdat($c1)
@v1 = weak_odr global i32 41, comdat($c2)
define weak_odr protected i32 @f1(i8* %this) comdat($c2) {
bb20:
store i8* %this, i8** null
br label %bb21
bb21:
ret i32 41
}
@r21 = global i32* @v1
@r22 = global i32(i8*)* @f1
@a21 = alias i32* @v1
@a22 = alias bitcast (i32* @v1 to i16*)
@a23 = alias i32(i8*)* @f1
@a24 = alias bitcast (i32(i8*)* @f1 to i16*)
@a25 = alias i16* @a24