Imported Upstream version 5.18.0.167

Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-20 08:25:10 +00:00
parent e19d552987
commit b084638f15
28489 changed files with 184 additions and 3866856 deletions

View File

@ -1,9 +0,0 @@
; RUN: opt -thinlto-bc -o %t %s
; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s
; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s
; M0: @g = external constant
; M1: @g = constant
@g = constant i8* bitcast (i8** @g to i8*), !type !0
!0 = !{i32 0, !"typeid"}

View File

@ -1,80 +0,0 @@
; RUN: opt -thinlto-bc -o %t %s
; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=THIN %s
; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=MERGED %s
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.0.24215"
; Internal comdat leader with type metadata. All comdat members need to live
; in the merged module, and the comdat needs to be renamed.
; MERGED: ${{"?lwt[^ ]+}} = comdat any
$lwt = comdat any
; External comdat leader, type metadata on non-leader. All comdat
; members need to live in the merged module, internal members need to
; be renamed.
; MERGED: $nlwt = comdat any
$nlwt = comdat any
; Comdat with two members without type metadata. All comdat members live in
; the ThinLTO module and no renaming needs to take place.
; THIN: $nt = comdat any
$nt = comdat any
; MERGED: @lwt_aliasee = private unnamed_addr global
; MERGED-SAME: comdat(${{"?lwt[^ ]+}})
@lwt_aliasee = private unnamed_addr global [1 x i8*] [i8* null], comdat($lwt), !type !0
; MERGED: {{@"?lwt_nl[^ ]+}} = hidden unnamed_addr global
; MERGED-SAME: comdat(${{"?lwt[^ ]+}})
; THIN: {{@"?lwt_nl[^ ]+}} = external hidden
@lwt_nl = internal unnamed_addr global i32 0, comdat($lwt)
; MERGED: @nlwt_aliasee = private unnamed_addr global
; MERGED-SAME: comdat($nlwt)
@nlwt_aliasee = private unnamed_addr global [1 x i8*] [i8* null], comdat($nlwt), !type !0
; MERGED: @nlwt = unnamed_addr global
; MERGED-SAME: comdat
; THIN: @nlwt = external
@nlwt = unnamed_addr global i32 0, comdat
; THIN: @nt = internal
; THIN-SAME: comdat
@nt = internal unnamed_addr global [1 x i8*] [i8* null], comdat
; THIN: @nt_nl = internal
; THIN-SAME: comdat($nt)
@nt_nl = internal unnamed_addr global i32 0, comdat($nt)
; MERGED: {{@"?lwt[^ ]+}} = hidden unnamed_addr alias
; THIN: {{@"?lwt[^ ]+}} = external hidden
@lwt = internal unnamed_addr alias [1 x i8*], [1 x i8*]* @lwt_aliasee
; MERGED: {{@"?nlwt_nl[^ ]+}} = hidden unnamed_addr alias
; THIN: {{@"?nlwt_nl[^ ]+}} = external hidden
@nlwt_nl = internal unnamed_addr alias [1 x i8*], [1 x i8*]* @nlwt_aliasee
; The functions below exist just to make sure the globals are used.
define i8* @lwt_fun() {
%1 = load i32, i32* @lwt_nl
%2 = getelementptr inbounds [1 x i8*], [1 x i8*]* @lwt, i32 0, i32 %1
%3 = load i8*, i8** %2
ret i8* %3
}
define i8* @nlwt_fun() {
%1 = load i32, i32* @nlwt
%2 = getelementptr inbounds [1 x i8*], [1 x i8*]* @nlwt_nl, i32 0, i32 %1
%3 = load i8*, i8** %2
ret i8* %3
}
define i8* @nt_fun() {
%1 = load i32, i32* @nt_nl
%2 = getelementptr inbounds [1 x i8*], [1 x i8*]* @nt, i32 0, i32 %1
%3 = load i8*, i8** %2
ret i8* %3
}
!0 = !{i64 8, !"?AVA@@"}

View File

@ -1,20 +0,0 @@
; RUN: opt -thinlto-bc -o %t %s
; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK0 %s
; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK1 %s
; CHECK0-NOT: @{{.*}}anon{{.*}}=
; CHECK0: @al = external global i8*
; CHECK0-NOT: @{{.*}}anon{{.*}}=
; CHECK1: @al = unnamed_addr alias i8*,
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.0.24215"
$al = comdat any
@anon = private unnamed_addr constant { [1 x i8*] } { [1 x i8*] [i8* null] }, comdat($al), !type !0
@al = external unnamed_addr alias i8*, getelementptr inbounds ({ [1 x i8*] }, { [1 x i8*] }* @anon, i32 0, i32 0, i32 1)
@foo = global i32 1
!0 = !{i64 8, !"?AVA@@"}

View File

@ -1,9 +0,0 @@
; RUN: opt -passes='no-op-module' -debug-pass-manager -thinlto-bc -thin-link-bitcode-file=%t2 -o %t %s 2>&1 | FileCheck %s --check-prefix=DEBUG_PM
; RUN: llvm-bcanalyzer -dump %t2 | FileCheck %s --check-prefix=BITCODE
; DEBUG_PM: ThinLTOBitcodeWriterPass
; BITCODE: Foo
define void @Foo() {
ret void
}

View File

@ -1,36 +0,0 @@
; Generate bitcode files with summary, as well as minimized bitcode without
; the debug metadata for the thin link.
; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t.thinlink.bc -o %t.bc %s
; RUN: llvm-dis -o - %t.bc | FileCheck %s
; RUN: llvm-bcanalyzer -dump %t.bc | FileCheck --check-prefix=BCA %s
; Make sure the combined index files produced by both the normal and the
; thin link bitcode files are identical
; RUN: llvm-lto -thinlto -o %t3 %t.bc
; Copy the minimized bitcode to the regular bitcode path so the module
; paths in the index are the same (save and restore the regular bitcode
; for use again further down).
; RUN: mv %t.bc %t.bc.sv
; RUN: cp %t.thinlink.bc %t.bc
; RUN: llvm-lto -thinlto -o %t4 %t.bc
; RUN: mv %t.bc.sv %t.bc
; RUN: diff %t3.thinlto.bc %t4.thinlto.bc
; Try again using -thinlto-action to produce combined index
; RUN: rm -f %t3.thinlto.bc %t4.thinlto.bc
; RUN: llvm-lto -thinlto-action=thinlink -o %t3.thinlto.bc %t.bc
; Copy the minimized bitcode to the regular bitcode path so the module
; paths in the index are the same.
; RUN: cp %t.thinlink.bc %t.bc
; RUN: llvm-lto -thinlto-action=thinlink -o %t4.thinlto.bc %t.bc
; RUN: diff %t3.thinlto.bc %t4.thinlto.bc
; BCA: <GLOBALVAL_SUMMARY_BLOCK
; CHECK: @g = global i8 42
@g = global i8 42
; CHECK: define void @f()
define void @f() {
ret void
}

View File

@ -1,37 +0,0 @@
; Test for a bug specific to the new pass manager where we may build a domtree
; to make more precise AA queries for functions.
;
; RUN: opt -aa-pipeline=default -passes='no-op-module' -debug-pass-manager -thinlto-bc -o %t %s
; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s
; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s
target triple = "x86_64-unknown-linux-gnu"
%struct.hoge = type { %struct.widget }
%struct.widget = type { i32 (...)** }
; M0: @global = local_unnamed_addr global
; M1-NOT: @global
@global = local_unnamed_addr global %struct.hoge { %struct.widget { i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @global.1, i32 0, inrange i32 0, i32 2) to i32 (...)**) } }, align 8
; M0: @global.1 = external unnamed_addr constant
; M1: @global.1 = linkonce_odr unnamed_addr constant
@global.1 = linkonce_odr unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @global.4 to i8*), i8* bitcast (i32 (%struct.widget*)* @quux to i8*)] }, align 8, !type !0
; M0: @global.2 = external global
; M1-NOT: @global.2
@global.2 = external global i8*
; M0: @global.3 = linkonce_odr constant
; M1-NOT: @global.3
@global.3 = linkonce_odr constant [22 x i8] c"zzzzzzzzzzzzzzzzzzzzz\00"
; M0: @global.4 = linkonce_odr constant
; M1: @global.4 = external constant
@global.4 = linkonce_odr constant { i8*, i8* }{ i8* bitcast (i8** getelementptr inbounds (i8*, i8** @global.2, i64 2) to i8*), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @global.3, i32 0, i32 0) }
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
declare i32 @quux(%struct.widget*) unnamed_addr
!0 = !{i64 16, !"yyyyyyyyyyyyyyyyyyyyyyyyy"}

View File

@ -1,40 +0,0 @@
; RUN: opt -thinlto-bc -o %t %s
; RUN: llvm-modextract -b -n 0 -o %t0 %t
; RUN: llvm-modextract -b -n 1 -o %t1 %t
; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=M0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=M1 %s
; RUN: llvm-bcanalyzer -dump %t0 | FileCheck --check-prefix=BCA0 %s
; RUN: llvm-bcanalyzer -dump %t1 | FileCheck --check-prefix=BCA1 %s
; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 2 module(s)
; BCA0: <GLOBALVAL_SUMMARY_BLOCK
; BCA1-NOT: <GLOBALVAL_SUMMARY_BLOCK
; M0: @g = external global i8{{$}}
; M1: @g = global i8 42, !type !0, !type !1, !type !2
@g = global i8 42, !type !1, !type !2, !type !4
; M0: define void @f()
; M1-NOT: @f()
define void @f() {
; M0: llvm.type.test{{.*}}metadata !"1$f50b51a12bb012bebbeff978335e34cf"
%p = call i1 @llvm.type.test(i8* null, metadata !0)
; M0: llvm.type.checked.load{{.*}}metadata !"2$f50b51a12bb012bebbeff978335e34cf"
%q = call {i8*, i1} @llvm.type.checked.load(i8* null, i32 0, metadata !3)
ret void
}
declare i1 @llvm.type.test(i8*, metadata)
declare {i8*, i1} @llvm.type.checked.load(i8*, i32, metadata)
!0 = distinct !{}
; M1: !0 = !{i32 0, !"1$f50b51a12bb012bebbeff978335e34cf"}
!1 = !{i32 0, !0}
; M1: !1 = !{i32 1, !"1$f50b51a12bb012bebbeff978335e34cf"}
!2 = !{i32 1, !0}
!3 = distinct !{}
; M1: !2 = !{i32 0, !"2$f50b51a12bb012bebbeff978335e34cf"}
!4 = !{i32 0, !3}

View File

@ -1,27 +0,0 @@
; RUN: opt -thinlto-bc -o %t %s
; RUN: llvm-modextract -b -n 0 -o %t0 %t
; RUN: llvm-modextract -b -n 1 -o %t1 %t
; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=M0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=M1 %s
; RUN: llvm-bcanalyzer -dump %t0 | FileCheck --check-prefix=BCA0 %s
; RUN: llvm-bcanalyzer -dump %t1 | FileCheck --check-prefix=BCA1 %s
; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 2 module(s)
; BCA0: <GLOBALVAL_SUMMARY_BLOCK
; BCA1-NOT: <GLOBALVAL_SUMMARY_BLOCK
; M0: @"g$581d7631532fa146ba4061179da39272" = external hidden global i8{{$}}
; M1: @"g$581d7631532fa146ba4061179da39272" = hidden global i8 42, !type !0
@g = internal global i8 42, !type !0
; M0: define i8* @f()
; M1-NOT: @f()
define i8* @f() {
; M0: ret i8* @"g$581d7631532fa146ba4061179da39272"
ret i8* @g
}
; M1: !0 = !{i32 0, !"typeid"}
!0 = !{i32 0, !"typeid"}

View File

@ -1,32 +0,0 @@
; RUN: opt -thinlto-bc -o %t %s
; RUN: llvm-modextract -b -n 0 -o %t0 %t
; RUN: llvm-modextract -b -n 1 -o %t1 %t
; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=M0 %s
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=M1 %s
; RUN: llvm-bcanalyzer -dump %t0 | FileCheck --check-prefix=BCA0 %s
; RUN: llvm-bcanalyzer -dump %t1 | FileCheck --check-prefix=BCA1 %s
; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 2 module(s)
; BCA0: <GLOBALVAL_SUMMARY_BLOCK
; BCA1-NOT: <GLOBALVAL_SUMMARY_BLOCK
; M0: @g = external global void ()*{{$}}
; M1: @g = global void ()* @"f$13757e0fb71915e385efa4dc9d1e08fd", !type !0
@g = global void ()* @f, !type !0
; M0: define hidden void @"f$13757e0fb71915e385efa4dc9d1e08fd"()
; M1: declare hidden void @"f$13757e0fb71915e385efa4dc9d1e08fd"()
define internal void @f() {
call void @f2()
ret void
}
; M0: define internal void @f2()
define internal void @f2() {
ret void
}
; M1: !0 = !{i32 0, !"typeid"}
!0 = !{i32 0, !"typeid"}

View File

@ -1,21 +0,0 @@
; RUN: opt -thinlto-bc -o %t %s
; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s
; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s
define [1 x i8*]* @source() {
ret [1 x i8*]* @g
}
; M0: @"g$84f59439b469192440047efc8de357fb" = external hidden constant [1 x i8*]{{$}}
; M1: @"g$84f59439b469192440047efc8de357fb" = hidden constant [1 x i8*] [i8* bitcast (i64 (i8*)* @"ok$84f59439b469192440047efc8de357fb" to i8*)]
@g = internal constant [1 x i8*] [
i8* bitcast (i64 (i8*)* @ok to i8*)
], !type !0
; M0: define hidden i64 @"ok$84f59439b469192440047efc8de357fb"
; M1: define available_externally hidden i64 @"ok$84f59439b469192440047efc8de357fb"
define internal i64 @ok(i8* %this) {
ret i64 42
}
!0 = !{i32 0, !"typeid"}

View File

@ -1,79 +0,0 @@
; RUN: opt -thinlto-bc -o %t %s
; RUN: llvm-modextract -b -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=M0 %s
; RUN: llvm-modextract -b -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=M1 %s
; M0: @g = external constant [9 x i8*]{{$}}
; M1: @g = constant [9 x i8*]
@g = constant [9 x i8*] [
i8* bitcast (i64 (i8*)* @ok1 to i8*),
i8* bitcast (i64 (i8*, i64)* @ok2 to i8*),
i8* bitcast (void (i8*)* @wrongtype1 to i8*),
i8* bitcast (i128 (i8*)* @wrongtype2 to i8*),
i8* bitcast (i64 ()* @wrongtype3 to i8*),
i8* bitcast (i64 (i8*, i8*)* @wrongtype4 to i8*),
i8* bitcast (i64 (i8*, i128)* @wrongtype5 to i8*),
i8* bitcast (i64 (i8*)* @usesthis to i8*),
i8* bitcast (i8 (i8*)* @reads to i8*)
], !type !0
; M0: define i64 @ok1
; M1: define available_externally i64 @ok1
define i64 @ok1(i8* %this) {
ret i64 42
}
; M0: define i64 @ok2
; M1: define available_externally i64 @ok2
define i64 @ok2(i8* %this, i64 %arg) {
%1 = tail call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %arg, i64 %arg)
ret i64 %arg
}
; M1: declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64, i64)
declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64, i64)
; M0: define void @wrongtype1
; M1: declare void @wrongtype1()
define void @wrongtype1(i8*) {
ret void
}
; M0: define i128 @wrongtype2
; M1: declare void @wrongtype2()
define i128 @wrongtype2(i8*) {
ret i128 0
}
; M0: define i64 @wrongtype3
; M1: declare void @wrongtype3()
define i64 @wrongtype3() {
ret i64 0
}
; M0: define i64 @wrongtype4
; M1: declare void @wrongtype4()
define i64 @wrongtype4(i8*, i8*) {
ret i64 0
}
; M0: define i64 @wrongtype5
; M1: declare void @wrongtype5()
define i64 @wrongtype5(i8*, i128) {
ret i64 0
}
; M0: define i64 @usesthis
; M1: declare void @usesthis()
define i64 @usesthis(i8* %this) {
%i = ptrtoint i8* %this to i64
ret i64 %i
}
; M0: define i8 @reads
; M1: declare void @reads()
define i8 @reads(i8* %this) {
%l = load i8, i8* %this
ret i8 %l
}
!0 = !{i32 0, !"typeid"}

View File

@ -1,44 +0,0 @@
; Generate bitcode files with summary, as well as minimized bitcode without
; the debug metadata for the thin link.
; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -o %t %s
; RUN: llvm-modextract -b -n 0 -o %t0.bc %t
; RUN: llvm-modextract -b -n 1 -o %t1.bc %t
; RUN: llvm-modextract -b -n 0 -o %t0.thinlink.bc %t2
; RUN: llvm-modextract -b -n 1 -o %t1.thinlink.bc %t2
; RUN: not llvm-modextract -b -n 2 -o - %t 2>&1 | FileCheck --check-prefix=ERROR %s
; RUN: llvm-dis -o - %t0.bc | FileCheck --check-prefix=M0 %s
; RUN: llvm-dis -o - %t1.bc | FileCheck --check-prefix=M1 %s
; RUN: llvm-bcanalyzer -dump %t0.bc | FileCheck --check-prefix=BCA0 %s
; RUN: llvm-bcanalyzer -dump %t1.bc | FileCheck --check-prefix=BCA1 %s
; Make sure the combined index files produced by both the normal and the
; thin link bitcode files are identical
; RUN: llvm-lto -thinlto -o %t3 %t0.bc
; Copy the minimized bitcode to the regular bitcode path so the module
; paths in the index are the same.
; RUN: cp %t0.thinlink.bc %t0.bc
; RUN: llvm-lto -thinlto -o %t4 %t0.bc
; RUN: diff %t3.thinlto.bc %t4.thinlto.bc
; ERROR: llvm-modextract: error: module index out of range; bitcode file contains 2 module(s)
; BCA0: <GLOBALVAL_SUMMARY_BLOCK
; BCA1: <FULL_LTO_GLOBALVAL_SUMMARY_BLOCK
; 16 = not eligible to import
; BCA1: <PERMODULE_GLOBALVAR_INIT_REFS {{.*}} op1=16
; BCA1-NOT: <GLOBALVAL_SUMMARY_BLOCK
$g = comdat any
; M0: @g = external global i8{{$}}
; M1: @g = global i8 42, comdat, !type !0
@g = global i8 42, comdat, !type !0
; M0: define i8* @f()
; M1-NOT: @f()
define i8* @f() {
ret i8* @g
}
; M1: !0 = !{i32 0, !"typeid"}
!0 = !{i32 0, !"typeid"}

View File

@ -1,30 +0,0 @@
; RUN: opt -thinlto-bc -thin-link-bitcode-file=%t2 -o %t %s
; RUN: llvm-dis -o - %t | FileCheck %s
; RUN: llvm-bcanalyzer -dump %t | FileCheck --check-prefix=BCA %s
; When not splitting the module, the thin link bitcode file should simply be a
; copy of the regular module.
; RUN: diff %t %t2
; BCA-NOT: <GLOBALVAL_SUMMARY_BLOCK
; CHECK: @llvm.global_ctors = appending global
@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @f }]
; CHECK: @g = internal global i8 42, !type !0
@g = internal global i8 42, !type !0
declare void @sink(i8*)
; CHECK: define internal void @f()
define internal void @f() {
call void @sink(i8* @g)
ret void
}
$h = comdat any
; CHECK: define void @h() comdat
define void @h() comdat {
ret void
}
!0 = !{i32 0, !"typeid"}