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,12 +0,0 @@
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext --compile-custom --compile-command="%python %/s.py arg1 arg2" --output-prefix %t %s | FileCheck %s
; REQUIRES: loadable_module
; Test that arguments are correctly passed in --compile-command. The output
; of bugpoint includes the output of the custom tool, so we just echo the args
; in the tool and check here.
; CHECK: Error: arg1 arg2
define void @noop() {
ret void
}

View File

@ -1,10 +0,0 @@
#!/usr/bin/env python
import sys
# Currently any print-out from the custom tool is interpreted as a crash
# (i.e. test is still interesting)
print("Error: " + ' '.join(sys.argv[1:]))
sys.exit(1)

View File

@ -1,13 +0,0 @@
; Test that bugpoint can narrow down the testcase to the important function
;
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null
; REQUIRES: loadable_module
define i32 @foo() { ret i32 1 }
define i32 @test() {
call i32 @test()
ret i32 %1
}
define i32 @bar() { ret i32 2 }

View File

@ -1,22 +0,0 @@
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes 2>&1 | FileCheck %s
; REQUIRES: loadable_module
; CHECK: DICompileUnit not listed in llvm.dbg.cu
; When bugpoint hacks at this testcase it will at one point create illegal IR
; that won't even pass the Verifier. A bugpoint *driver* built with assertions
; should not assert on it, but reject the malformed intermediate step.
define void @f() !dbg !9 { ret void }
!llvm.dbg.cu = !{!0, !1, !2, !3, !4, !5}
!0 = distinct !DICompileUnit(language: 12, file: !6)
!1 = distinct !DICompileUnit(language: 12, file: !6)
!2 = distinct !DICompileUnit(language: 12, file: !6)
!3 = distinct !DICompileUnit(language: 12, file: !6)
!4 = distinct !DICompileUnit(language: 12, file: !6)
!5 = distinct !DICompileUnit(language: 12, file: !6)
!6 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
!llvm.module.flags = !{!7, !8}
!7 = !{i32 2, !"Dwarf Version", i32 4}
!8 = !{i32 2, !"Debug Info Version", i32 3}
!9 = distinct !DISubprogram(unit: !0)

View File

@ -1,58 +0,0 @@
; REQUIRES: loadable_module
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes -disable-namedmd-remove -disable-strip-debuginfo -disable-strip-debug-types > /dev/null
; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
;
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t-nodebug -bugpoint-crashcalls -silence-passes -disable-namedmd-remove > /dev/null
; RUN: llvm-dis %t-nodebug-reduced-simplified.bc -o - | FileCheck %s --check-prefix=NODEBUG
;
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t-notype -bugpoint-crashcalls -silence-passes -disable-namedmd-remove -disable-strip-debuginfo > /dev/null
; RUN: llvm-dis %t-notype-reduced-simplified.bc -o - | FileCheck %s --check-prefix=NOTYPE
;
; Bugpoint should keep the call's metadata attached to the call.
; CHECK: call void @foo(), !dbg ![[LOC:[0-9]+]], !attach ![[CALL:[0-9]+]]
; NODEBUG: call void @foo(), !attach ![[CALL:[0-9]+]]
; NOTYPE: call void @foo(), !dbg ![[LOC:[0-9]+]], !attach ![[CALL:[0-9]+]]
; NODEBUG-NOT: call void @foo(), !attach ![[CALL:[0-9]+]]
; NOTYPE-NOT: !DIBasicType
; NOTYPE: !DICompileUnit
; NOTYPE-NOT: !DIBasicType
; CHECK-DAG: ![[LOC]] = !DILocation(line: 104, column: 105, scope: ![[SCOPE:[0-9]+]])
; CHECK-DAG: ![[SCOPE]] = distinct !DISubprogram(name: "test",{{.*}}file: ![[FILE:[0-9]+]]
; CHECK-DAG: ![[FILE]] = !DIFile(filename: "source.c", directory: "/dir")
; CHECK-DAG: ![[CALL]] = !{!"the call to foo"}
%rust_task = type {}
define void @test(i32* %a, i8* %b) {
%s = mul i8 22, 9, !attach !0, !dbg !10
store i8 %s, i8* %b, !attach !1, !dbg !11
call void @foo(), !attach !2, !dbg !12
store i32 7, i32* %a, !attach !3, !dbg !13
%t = add i32 0, 5, !attach !4, !dbg !14
ret void
}
declare void @foo()
!llvm.module.flags = !{!17}
!llvm.dbg.cu = !{!8}
!0 = !{!"boring"}
!1 = !{!"uninteresting"}
!2 = !{!"the call to foo"}
!3 = !{!"noise"}
!4 = !{!"filler"}
!8 = distinct !DICompileUnit(language: DW_LANG_C99, file: !15)
!9 = distinct !DISubprogram(name: "test", file: !15, type: !18, unit: !8)
!10 = !DILocation(line: 100, column: 101, scope: !9)
!11 = !DILocation(line: 102, column: 103, scope: !9)
!12 = !DILocation(line: 104, column: 105, scope: !9)
!13 = !DILocation(line: 106, column: 107, scope: !9)
!14 = !DILocation(line: 108, column: 109, scope: !9)
!15 = !DIFile(filename: "source.c", directory: "/dir")
!16 = !{}
!17 = !{i32 1, !"Debug Info Version", i32 3}
!18 = !DISubroutineType(types: !19)
!19 = !{!20, !20}
!20 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)

View File

@ -1,39 +0,0 @@
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes -disable-strip-debuginfo > /dev/null
; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
; RUN-DISABLE: bugpoint -disable-namedmd-remove -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes > /dev/null
; RUN-DISABLE: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
; REQUIRES: loadable_module
; CHECK: !llvm.dbg.cu = !{![[FIRST:[0-9]+]], ![[SECOND:[0-9]+]]}
; CHECK-DISABLE: !llvm.dbg.cu = !{![[FIRST:[0-9]+]], ![[SECOND:[0-9]+]],
; CHECK-DISABLE-SAME: ![[THIRD:[0-9]+]], ![[FOURTH:[0-9]+]], ![[FIFTH:[0-9]+]]}
!llvm.dbg.cu = !{!0, !1, !2, !3, !4, !5}
; CHECK-NOT: !named
; CHECK-DISABLE: !named
!named = !{!0, !1, !2, !3, !4, !5}
; CHECK: !llvm.module.flags = !{![[DIVERSION:[0-9]+]]}
!llvm.module.flags = !{!6, !7}
; CHECK-DAG: ![[FIRST]] = distinct !DICompileUnit(language: DW_LANG_Julia,
; CHECK-DAG: ![[SECOND]] = distinct !DICompileUnit(language: DW_LANG_Julia,
; CHECK-DAG: ![[DIVERSION]] = !{i32 2, !"Debug Info Version", i32 3}
; CHECK-DAG: !DIFile(filename: "a", directory: "b")
; 4 nodes survive. Due to renumbering !4 should not exist
; CHECK-NOT: !4
!0 = distinct !DICompileUnit(language: DW_LANG_Julia,
file: !8)
!1 = distinct !DICompileUnit(language: DW_LANG_Julia,
file: !8)
!2 = distinct !DICompileUnit(language: DW_LANG_Julia,
file: !8)
!3 = distinct !DICompileUnit(language: DW_LANG_Julia,
file: !8)
!4 = distinct !DICompileUnit(language: DW_LANG_Julia,
file: !8)
!5 = distinct !DICompileUnit(language: DW_LANG_Julia,
file: !8)
!6 = !{i32 2, !"Dwarf Version", i32 2}
!7 = !{i32 2, !"Debug Info Version", i32 3}
!8 = !DIFile(filename: "a", directory: "b")

View File

@ -1,18 +0,0 @@
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes
; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
; REQUIRES: loadable_module
; Test to make sure that arguments are removed from the function if they are
; unnecessary. And clean up any types that frees up too.
; CHECK: ModuleID
; CHECK-NOT: struct.anon
%struct.anon = type { i32 }
declare i32 @test2()
; CHECK: define void @test() {
define i32 @test(i32 %A, %struct.anon* %B, float %C) {
call i32 @test2()
ret i32 %1
}

View File

@ -1,17 +0,0 @@
; Test that bugpoint can reduce the set of functions by replacing them with null.
;
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -replace-funcs-with-null -bugpoint-crash-decl-funcs -silence-passes -safe-run-llc
; REQUIRES: loadable_module
@foo2 = alias i32 (), i32 ()* @foo
define i32 @foo() { ret i32 1 }
define i32 @test() {
call i32 @test()
ret i32 %1
}
define i32 @bar() { ret i32 2 }
@llvm.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @foo to i8*)], section "llvm.metadata"

View File

@ -1,21 +0,0 @@
; REQUIRES: loadable_module
; RUN: echo "import sys" > %t.py
; RUN: echo "print('args = ' + str(sys.argv))" >> %t.py
; RUN: echo "exit(1)" >> %t.py
; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -opt-command="%python" -opt-args %t.py | FileCheck %s
; RUN: not --crash opt -load %llvmshlibdir/BugpointPasses%shlibext %s -bugpoint-crashcalls -disable-symbolication 2>&1 | FileCheck --check-prefix=CRASH %s
; Test that bugpoint disables symbolication on the opt tool to reduce runtime overhead when opt crashes
; CHECK: args = {{.*}}'-disable-symbolication'
; Test that opt, when it crashes & is passed -disable-symbolication, doesn't symbolicate.
; In theory this test should maybe be in test/tools/opt or
; test/Transforms, but since there doesn't seem to be another convenient way to
; crash opt, apart from the BugpointPasses dynamic plugin, this is the spot for
; now.
; CRASH-NOT: Signals.inc
define void @f() {
call void @f()
ret void
}