Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@@ -0,0 +1,49 @@
# RUN: llc -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser parses machine functions correctly.
--- |
define i32 @foo() {
entry:
ret i32 0
}
define i32 @bar() {
start:
ret i32 0
}
define i32 @test() {
start:
ret i32 0
}
...
---
# CHECK-LABEL: name: foo
# CHECK: body:
# CHECK-NEXT: bb.0.entry:
name: foo
body: |
bb.0.entry:
...
---
# CHECK-LABEL: name: bar
# CHECK: body:
# CHECK-NEXT: bb.0.start (align 4):
# CHECK: bb.1 (address-taken):
name: bar
body: |
bb.0.start (align 4):
bb.1 (address-taken):
...
---
# CHECK-LABEL: name: test
# CHECK: body:
# CHECK-NEXT: bb.0.start (address-taken, align 4):
# CHECK: bb.1 (address-taken, align 4):
name: test
body: |
bb.0.start (align 4, address-taken):
bb.1 (address-taken, align 4):
...

View File

@@ -0,0 +1,16 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
define i32 @foo() {
entry:
ret i32 0
}
...
---
name: foo
body: |
; CHECK: [[@LINE+1]]:13: expected ':'
bb.0.entry
...

View File

@@ -0,0 +1,28 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
define i32 @foo(i32 %a) {
entry:
%0 = icmp sle i32 %a, 10
br i1 %0, label %less, label %exit
less:
ret i32 0
exit:
ret i32 %a
}
...
---
name: foo
body: |
bb.0.entry:
; CHECK: [[@LINE+1]]:29: expected a machine basic block reference
successors: %bb.1.less, 2
bb.1.less:
bb.2.exit:
...

View File

@@ -0,0 +1,91 @@
# RUN: llc -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser parses machine frame info properties
# correctly.
--- |
define i32 @test(i32 %a) {
entry:
%b = alloca i32
store i32 %a, i32* %b
%c = load i32, i32* %b
ret i32 %c
}
define i32 @test2(i32 %a) {
entry:
%b = alloca i32
store i32 %a, i32* %b
%c = load i32, i32* %b
ret i32 %c
}
...
---
name: test
tracksRegLiveness: true
# CHECK: frameInfo:
# CHECK-NEXT: isFrameAddressTaken: false
# CHECK-NEXT: isReturnAddressTaken: false
# CHECK-NEXT: hasStackMap: false
# CHECK-NEXT: hasPatchPoint: false
# CHECK-NEXT: stackSize: 0
# CHECK-NEXT: offsetAdjustment: 0
# Note: max alignment can be target specific when printed.
# CHECK-NEXT: maxAlignment:
# CHECK-NEXT: adjustsStack: false
# CHECK-NEXT: hasCalls: false
# CHECK-NEXT: stackProtector: ''
# CHECK-NEXT: maxCallFrameSize:
# CHECK-NEXT: hasOpaqueSPAdjustment: false
# CHECK-NEXT: hasVAStart: false
# CHECK-NEXT: hasMustTailInVarArgFunc: false
# CHECK-NEXT: savePoint: ''
# CHECK-NEXT: restorePoint: ''
# CHECK: body
frameInfo:
maxAlignment: 4
body: |
bb.0.entry:
...
---
name: test2
tracksRegLiveness: true
# CHECK: test2
# CHECK: frameInfo:
# CHECK-NEXT: isFrameAddressTaken: true
# CHECK-NEXT: isReturnAddressTaken: true
# CHECK-NEXT: hasStackMap: true
# CHECK-NEXT: hasPatchPoint: true
# CHECK-NEXT: stackSize: 4
# CHECK-NEXT: offsetAdjustment: 4
# Note: max alignment can be target specific when printed.
# CHECK-NEXT: maxAlignment:
# CHECK-NEXT: adjustsStack: true
# CHECK-NEXT: hasCalls: true
# CHECK-NEXT: stackProtector: ''
# CHECK-NEXT: maxCallFrameSize: 4
# CHECK-NEXT: hasOpaqueSPAdjustment: true
# CHECK-NEXT: hasVAStart: true
# CHECK-NEXT: hasMustTailInVarArgFunc: true
# CHECK: body
frameInfo:
isFrameAddressTaken: true
isReturnAddressTaken: true
hasStackMap: true
hasPatchPoint: true
stackSize: 4
offsetAdjustment: 4
maxAlignment: 4
adjustsStack: true
hasCalls: true
maxCallFrameSize: 4
hasOpaqueSPAdjustment: true
hasVAStart: true
hasMustTailInVarArgFunc: true
body: |
bb.0.entry:
...

View File

@@ -0,0 +1,40 @@
# RUN: llc -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser parses GlobalISel MachineFunction
# properties correctly.
# This doesn't require GlobalISel to be built, as the properties are always
# available in CodeGen.
--- |
define i32 @test_defaults() {
entry:
ret i32 0
}
define i32 @test() {
start:
ret i32 0
}
...
---
# CHECK-LABEL: name: test_defaults
# CHECK: legalized: false
# CHECK-NEXT: regBankSelected: false
# CHECK-NEXT: selected: false
name: test_defaults
body: |
bb.0:
...
---
# CHECK-LABEL: name: test
# CHECK: legalized: true
# CHECK-NEXT: regBankSelected: true
# CHECK-NEXT: selected: true
name: test
legalized: true
regBankSelected: true
selected: true
body: |
bb.0:
...

View File

@@ -0,0 +1,53 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
define i32 @test_jumptable(i32 %in) {
entry:
switch i32 %in, label %def [
i32 0, label %lbl1
i32 1, label %lbl2
i32 2, label %lbl3
i32 3, label %lbl4
]
def:
ret i32 0
lbl1:
ret i32 1
lbl2:
ret i32 2
lbl3:
ret i32 4
lbl4:
ret i32 8
}
...
---
name: test_jumptable
jumpTable:
# CHECK: [[@LINE+1]]:18: unknown enumerated scalar
kind: switch
entries:
- id: 0
blocks: [ '%bb.3.lbl1', '%bb.4.lbl2', '%bb.5.lbl3', '%bb.6.lbl4' ]
body: |
bb.0.entry:
bb.1.entry:
bb.2.def:
bb.3.lbl1:
bb.4.lbl2:
bb.5.lbl3:
bb.6.lbl4:
...

View File

@@ -0,0 +1,3 @@
if 'native' not in config.available_features:
config.unsupported = True

View File

@@ -0,0 +1,22 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
# This test ensures an error is reported if the embedded LLVM IR contains an
# error.
--- |
; CHECK: [[@LINE+3]]:15: use of undefined value '%a'
define i32 @foo(i32 %x, i32 %y) {
%z = alloca i32, align 4
store i32 %a, i32* %z, align 4
br label %Test
Test:
%m = load i32, i32* %z, align 4
%cond = icmp eq i32 %y, %m
br i1 %cond, label %IfEqual, label %IfUnequal
IfEqual:
ret i32 1
IfUnequal:
ret i32 0
}
...

View File

@@ -0,0 +1,35 @@
# RUN: llc -run-pass none -o - %s | FileCheck %s
# This test ensures that the LLVM IR that's embedded with MIR is parsed
# correctly.
--- |
; CHECK: define i32 @foo(i32 %x, i32 %y)
; CHECK: %z = alloca i32, align 4
; CHECK: store i32 %x, i32* %z, align 4
; CHECK: br label %Test
; CHECK: Test:
; CHECK: %m = load i32, i32* %z, align 4
; CHECK: %cond = icmp eq i32 %y, %m
; CHECK: br i1 %cond, label %IfEqual, label %IfUnequal
; CHECK: IfEqual:
; CHECK: ret i32 1
; CHECK: IfUnequal:
; CHECK: ret i32 0
define i32 @foo(i32 %x, i32 %y) {
%z = alloca i32, align 4
store i32 %x, i32* %z, align 4
br label %Test
Test:
%m = load i32, i32* %z, align 4
%cond = icmp eq i32 %y, %m
br i1 %cond, label %IfEqual, label %IfUnequal
IfEqual:
ret i32 1
IfUnequal:
ret i32 0
}
...
---
name: foo
...

View File

@@ -0,0 +1,7 @@
# RUN: llc -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser accepts files without the LLVM IR.
---
# CHECK: name: foo
name: foo
...

View File

@@ -0,0 +1,17 @@
# RUN: llc -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser preserves unnamed LLVM IR block
# references.
--- |
define i32 @foo() {
ret i32 0
}
...
---
name: foo
body: |
; CHECK: bb.0 (%ir-block.0):
bb.0 (%ir-block.0):
...

View File

@@ -0,0 +1,18 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
define i32 @foo() {
entry:
ret i32 0
}
...
---
name: foo
body: |
; CHECK: [[@LINE+3]]:3: redefinition of machine basic block with id #0
bb.0:
bb.0:
...

View File

@@ -0,0 +1,15 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
--- |
define i32 @foo() {
ret i32 0
}
...
---
name: foo
body: |
; CHECK: [[@LINE+1]]:9: use of undefined IR block '%ir-block.10'
bb.0 (%ir-block.10):
...

View File

@@ -0,0 +1,18 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
# This test ensures that an error is reported whenever the MIR parser can't find
# a basic block with the machine basis block's name.
--- |
define i32 @foo() {
entry:
ret i32 0
}
...
---
name: foo
body: |
; CHECK: [[@LINE+1]]:3: basic block 'entrie' is not defined in the function 'foo'
bb.0.entrie:
...

View File

@@ -0,0 +1,15 @@
# RUN: llc -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser accepts files with llvm IR but
# no machine function body.
--- |
; CHECK: define i32 @foo()
define i32 @foo() {
ret i32 0
}
...
---
# CHECK: name: foo
name: foo
...

View File

@@ -0,0 +1,19 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
# This test ensures that an error is reported when the mir file has LLVM IR and
# one of the machine functions has a name that doesn't match any function in
# the LLVM IR.
--- |
define i32 @foo() {
ret i32 0
}
...
---
name: foo
...
---
# CHECK: function 'faa' isn't defined in the provided LLVM IR
name: faa
...

View File

@@ -0,0 +1,22 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
# This test ensures that an error is reported when a machine function doesn't
# have a name attribute.
--- |
define i32 @foo() {
ret i32 0
}
define i32 @bar() {
ret i32 0
}
...
---
# CHECK: [[@LINE+1]]:1: missing required key 'name'
nme: foo
...
---
name: bar
...

View File

@@ -0,0 +1,10 @@
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
# This test ensures that the machine function errors are reported correctly.
---
name: foo
...
---
# CHECK: redefinition of machine function 'foo'
name: foo
...

View File

@@ -0,0 +1,53 @@
# RUN: llc -run-pass none -o - %s | FileCheck %s
# This test ensures that the MIR parser parses machine functions correctly.
--- |
define i32 @foo() {
ret i32 0
}
define i32 @bar() {
ret i32 0
}
define i32 @func() {
ret i32 0
}
define i32 @func2() {
ret i32 0
}
...
---
# CHECK: name: foo
# CHECK-NEXT: alignment:
# CHECK-NEXT: exposesReturnsTwice: false
# CHECK: ...
name: foo
...
---
# CHECK: name: bar
# CHECK-NEXT: alignment:
# CHECK-NEXT: exposesReturnsTwice: false
# CHECK: ...
name: bar
...
---
# CHECK: name: func
# CHECK-NEXT: alignment: 8
# CHECK-NEXT: exposesReturnsTwice: false
# CHECK: ...
name: func
alignment: 8
...
---
# CHECK: name: func2
# CHECK-NEXT: alignment: 16
# CHECK-NEXT: exposesReturnsTwice: true
# CHECK: ...
name: func2
alignment: 16
exposesReturnsTwice: true
...

View File

@@ -0,0 +1,21 @@
# RUN: llc -run-pass expand-isel-pseudos -run-pass peephole-opt -debug-pass=Arguments -o - %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=PSEUDO_PEEPHOLE
# RUN: llc -run-pass expand-isel-pseudos,peephole-opt -debug-pass=Arguments -o - %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=PSEUDO_PEEPHOLE
# RUN: llc -run-pass peephole-opt -run-pass expand-isel-pseudos -debug-pass=Arguments -o - %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=PEEPHOLE_PSEUDO
# RUN: llc -run-pass peephole-opt,expand-isel-pseudos -debug-pass=Arguments -o - %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=PEEPHOLE_PSEUDO
# REQUIRES: asserts
# This test ensures that the command line accepts
# several run passes on the same command line and
# actually create the proper pipeline for it.
# PSEUDO_PEEPHOLE: -expand-isel-pseudos
# PSEUDO_PEEPHOLE-SAME: {{(-machineverifier )?}}-peephole-opt
# PEEPHOLE_PSEUDO: -peephole-opt {{(-machineverifier )?}}-expand-isel-pseudos
# Make sure there are no other passes happening after what we asked.
# CHECK-NEXT: --- |
---
# CHECK: name: foo
name: foo
body: |
bb.0:
...

Some files were not shown because too many files have changed in this diff Show More