From: Mehdi Amini Date: Tue, 4 Aug 2015 06:32:45 +0000 (+0000) Subject: Move generic MIR tests in their own subdir, requires "native" as well X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=765426e84d3aa39692edb0bd75c3fcf7e5ff1264;p=oota-llvm.git Move generic MIR tests in their own subdir, requires "native" as well These tests rely on the native backend to be built-in. From: Mehdi Amini git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243959 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/MIR/Generic/basic-blocks.mir b/test/CodeGen/MIR/Generic/basic-blocks.mir new file mode 100644 index 00000000000..17313047576 --- /dev/null +++ b/test/CodeGen/MIR/Generic/basic-blocks.mir @@ -0,0 +1,49 @@ +# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %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 + } + +... +--- +# CHECK: name: foo +# CHECK: body: +# CHECK-NEXT: - id: 0 +# CHECK-NEXT: name: entry +# CHECK-NEXT: alignment: 0 +# CHECK-NEXT: isLandingPad: false +# CHECK-NEXT: addressTaken: false +name: foo +body: + - id: 0 + name: entry +... +--- +# CHECK: name: bar +# CHECK: body: +# CHECK-NEXT: - id: 0 +# CHECK-NEXT: name: start +# CHECK-NEXT: alignment: 4 +# CHECK-NEXT: isLandingPad: false +# CHECK-NEXT: addressTaken: false +# CHECK-NEXT: - id: 1 +# CHECK-NEXT: alignment: 0 +# CHECK-NEXT: isLandingPad: false +# CHECK-NEXT: addressTaken: true +name: bar +body: + - id: 0 + name: start + alignment: 4 + - id: 1 + addressTaken: true +... diff --git a/test/CodeGen/MIR/Generic/expected-eof-after-successor-mbb.mir b/test/CodeGen/MIR/Generic/expected-eof-after-successor-mbb.mir new file mode 100644 index 00000000000..25ae5119297 --- /dev/null +++ b/test/CodeGen/MIR/Generic/expected-eof-after-successor-mbb.mir @@ -0,0 +1,29 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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: + - id: 0 + name: entry + # CHECK: [[@LINE+1]]:46: expected end of string after the machine basic block reference + successors: [ '%bb.1.less', '%bb.2.exit 2' ] + - id: 1 + name: less + - id: 2 + name: exit +... diff --git a/test/CodeGen/MIR/Generic/expected-mbb-reference-for-successor-mbb.mir b/test/CodeGen/MIR/Generic/expected-mbb-reference-for-successor-mbb.mir new file mode 100644 index 00000000000..ce9192901d7 --- /dev/null +++ b/test/CodeGen/MIR/Generic/expected-mbb-reference-for-successor-mbb.mir @@ -0,0 +1,29 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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: + - id: 0 + name: entry + # CHECK: [[@LINE+1]]:35: expected a machine basic block reference + successors: [ '%bb.1.less', '2' ] + - id: 1 + name: less + - id: 2 + name: exit +... diff --git a/test/CodeGen/MIR/Generic/frame-info.mir b/test/CodeGen/MIR/Generic/frame-info.mir new file mode 100644 index 00000000000..c5468f94f33 --- /dev/null +++ b/test/CodeGen/MIR/Generic/frame-info.mir @@ -0,0 +1,91 @@ +# RUN: llc -start-after machine-sink -stop-after machine-sink -o /dev/null %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 +isSSA: true +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: maxCallFrameSize: 0 +# CHECK-NEXT: hasOpaqueSPAdjustment: false +# CHECK-NEXT: hasVAStart: false +# CHECK-NEXT: hasMustTailInVarArgFunc: false +# CHECK: body +frameInfo: + maxAlignment: 4 +body: + - id: 0 + name: entry +... +--- +name: test2 +isSSA: true +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: 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: + - id: 0 + name: entry +... + diff --git a/test/CodeGen/MIR/Generic/function-missing-machine-function.mir b/test/CodeGen/MIR/Generic/function-missing-machine-function.mir new file mode 100644 index 00000000000..71b5b284534 --- /dev/null +++ b/test/CodeGen/MIR/Generic/function-missing-machine-function.mir @@ -0,0 +1,13 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s +# This test verifies that an error is reported when a MIR file has some +# function but is missing a corresponding machine function. + +# CHECK: no machine function information for function 'foo' in the MIR file + +--- | + + define i32 @foo() { + ret i32 0 + } + +... diff --git a/test/CodeGen/MIR/Generic/invalid-jump-table-kind.mir b/test/CodeGen/MIR/Generic/invalid-jump-table-kind.mir new file mode 100644 index 00000000000..4876f795386 --- /dev/null +++ b/test/CodeGen/MIR/Generic/invalid-jump-table-kind.mir @@ -0,0 +1,54 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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: + - id: 0 + name: entry + - id: 1 + name: entry + - id: 2 + name: def + - id: 3 + name: lbl1 + - id: 4 + name: lbl2 + - id: 5 + name: lbl3 + - id: 6 + name: lbl4 +... diff --git a/test/CodeGen/MIR/Generic/lit.local.cfg b/test/CodeGen/MIR/Generic/lit.local.cfg new file mode 100644 index 00000000000..f3f03bd7047 --- /dev/null +++ b/test/CodeGen/MIR/Generic/lit.local.cfg @@ -0,0 +1,3 @@ +if 'native' not in config.available_features: + config.unsupported = True + diff --git a/test/CodeGen/MIR/Generic/llvm-ir-error-reported.mir b/test/CodeGen/MIR/Generic/llvm-ir-error-reported.mir new file mode 100644 index 00000000000..3508c341c44 --- /dev/null +++ b/test/CodeGen/MIR/Generic/llvm-ir-error-reported.mir @@ -0,0 +1,22 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 + } + +... diff --git a/test/CodeGen/MIR/Generic/llvmIR.mir b/test/CodeGen/MIR/Generic/llvmIR.mir new file mode 100644 index 00000000000..3c084ad7d39 --- /dev/null +++ b/test/CodeGen/MIR/Generic/llvmIR.mir @@ -0,0 +1,37 @@ +# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %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 +body: + - id: 0 +... diff --git a/test/CodeGen/MIR/Generic/llvmIRMissing.mir b/test/CodeGen/MIR/Generic/llvmIRMissing.mir new file mode 100644 index 00000000000..80cea5a6fda --- /dev/null +++ b/test/CodeGen/MIR/Generic/llvmIRMissing.mir @@ -0,0 +1,9 @@ +# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s +# This test ensures that the MIR parser accepts files without the LLVM IR. + +--- +# CHECK: name: foo +name: foo +body: + - id: 0 +... diff --git a/test/CodeGen/MIR/Generic/machine-basic-block-expected-ir-block.mir b/test/CodeGen/MIR/Generic/machine-basic-block-expected-ir-block.mir new file mode 100644 index 00000000000..2f3d40af792 --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-basic-block-expected-ir-block.mir @@ -0,0 +1,16 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s + +--- | + + define i32 @foo() { + ret i32 0 + } + +... +--- +name: foo +body: + - id: 0 +# CHECK: [[@LINE+1]]:19: expected an IR block reference + ir-block: '0' +... diff --git a/test/CodeGen/MIR/Generic/machine-basic-block-ir-block-reference.mir b/test/CodeGen/MIR/Generic/machine-basic-block-ir-block-reference.mir new file mode 100644 index 00000000000..ccbab534388 --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-basic-block-ir-block-reference.mir @@ -0,0 +1,19 @@ +# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %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: id: 0 +# CHECK: ir-block: '%ir-block.0' + - id: 0 + ir-block: '%ir-block.0' +... diff --git a/test/CodeGen/MIR/Generic/machine-basic-block-redefinition-error.mir b/test/CodeGen/MIR/Generic/machine-basic-block-redefinition-error.mir new file mode 100644 index 00000000000..deac3b0b69b --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-basic-block-redefinition-error.mir @@ -0,0 +1,17 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s + +--- | + + define i32 @foo() { + entry: + ret i32 0 + } + +... +--- +name: foo +body: + # CHECK: redefinition of machine basic block with id #0 + - id: 0 + - id: 0 +... diff --git a/test/CodeGen/MIR/Generic/machine-basic-block-undefined-ir-block.mir b/test/CodeGen/MIR/Generic/machine-basic-block-undefined-ir-block.mir new file mode 100644 index 00000000000..76d561e61fa --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-basic-block-undefined-ir-block.mir @@ -0,0 +1,16 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s + +--- | + + define i32 @foo() { + ret i32 0 + } + +... +--- +name: foo +body: + - id: 0 +# CHECK: [[@LINE+1]]:19: use of undefined IR block '%ir-block.10' + ir-block: '%ir-block.10' +... diff --git a/test/CodeGen/MIR/Generic/machine-basic-block-unknown-name.mir b/test/CodeGen/MIR/Generic/machine-basic-block-unknown-name.mir new file mode 100644 index 00000000000..df8eee9d270 --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-basic-block-unknown-name.mir @@ -0,0 +1,19 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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+2]]:18: basic block 'entrie' is not defined in the function 'foo' + - id: 0 + name: entrie +... diff --git a/test/CodeGen/MIR/Generic/machine-function-missing-body-error.mir b/test/CodeGen/MIR/Generic/machine-function-missing-body-error.mir new file mode 100644 index 00000000000..0dc7477f627 --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-function-missing-body-error.mir @@ -0,0 +1,15 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s +# This test ensures that the MIR parser reports an error when it encounters a +# machine function with an empty body. + +--- | + + define i32 @foo() { + ret i32 0 + } + +... +--- +# CHECK: machine function 'foo' requires at least one machine basic block in its body +name: foo +... diff --git a/test/CodeGen/MIR/Generic/machine-function-missing-function.mir b/test/CodeGen/MIR/Generic/machine-function-missing-function.mir new file mode 100644 index 00000000000..424c34aae84 --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-function-missing-function.mir @@ -0,0 +1,23 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 +body: + - id: 0 +... +--- +# CHECK: function 'faa' isn't defined in the provided LLVM IR +name: faa +body: + - id: 0 +... diff --git a/test/CodeGen/MIR/Generic/machine-function-missing-name.mir b/test/CodeGen/MIR/Generic/machine-function-missing-name.mir new file mode 100644 index 00000000000..a868a65d35f --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-function-missing-name.mir @@ -0,0 +1,26 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 +body: + - id: 0 +... +--- +name: bar +body: + - id: 0 +... diff --git a/test/CodeGen/MIR/Generic/machine-function-redefinition-error.mir b/test/CodeGen/MIR/Generic/machine-function-redefinition-error.mir new file mode 100644 index 00000000000..be84161b563 --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-function-redefinition-error.mir @@ -0,0 +1,10 @@ +# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 +... diff --git a/test/CodeGen/MIR/Generic/machine-function.mir b/test/CodeGen/MIR/Generic/machine-function.mir new file mode 100644 index 00000000000..afd10ab02c2 --- /dev/null +++ b/test/CodeGen/MIR/Generic/machine-function.mir @@ -0,0 +1,66 @@ +# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %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-NEXT: hasInlineAsm: false +# CHECK: ... +name: foo +body: + - id: 0 +... +--- +# CHECK: name: bar +# CHECK-NEXT: alignment: +# CHECK-NEXT: exposesReturnsTwice: false +# CHECK-NEXT: hasInlineAsm: false +# CHECK: ... +name: bar +body: + - id: 0 +... +--- +# CHECK: name: func +# CHECK-NEXT: alignment: 8 +# CHECK-NEXT: exposesReturnsTwice: false +# CHECK-NEXT: hasInlineAsm: false +# CHECK: ... +name: func +alignment: 8 +body: + - id: 0 +... +--- +# CHECK: name: func2 +# CHECK-NEXT: alignment: 16 +# CHECK-NEXT: exposesReturnsTwice: true +# CHECK-NEXT: hasInlineAsm: true +# CHECK: ... +name: func2 +alignment: 16 +exposesReturnsTwice: true +hasInlineAsm: true +body: + - id: 0 +... diff --git a/test/CodeGen/MIR/Generic/register-info.mir b/test/CodeGen/MIR/Generic/register-info.mir new file mode 100644 index 00000000000..9585faa9622 --- /dev/null +++ b/test/CodeGen/MIR/Generic/register-info.mir @@ -0,0 +1,40 @@ +# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s +# This test ensures that the MIR parser parses machine register info properties +# correctly. + +--- | + + define i32 @foo() { + entry: + ret i32 0 + } + + define i32 @bar() { + start: + ret i32 0 + } + +... +--- +# CHECK: name: foo +# CHECK: isSSA: false +# CHECK-NEXT: tracksRegLiveness: false +# CHECK-NEXT: tracksSubRegLiveness: false +# CHECK: ... +name: foo +body: + - id: 0 +... +--- +# CHECK: name: bar +# CHECK: isSSA: false +# CHECK-NEXT: tracksRegLiveness: true +# CHECK-NEXT: tracksSubRegLiveness: true +# CHECK: ... +name: bar +isSSA: false +tracksRegLiveness: true +tracksSubRegLiveness: true +body: + - id: 0 +... diff --git a/test/CodeGen/MIR/basic-blocks.mir b/test/CodeGen/MIR/basic-blocks.mir deleted file mode 100644 index 17313047576..00000000000 --- a/test/CodeGen/MIR/basic-blocks.mir +++ /dev/null @@ -1,49 +0,0 @@ -# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %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 - } - -... ---- -# CHECK: name: foo -# CHECK: body: -# CHECK-NEXT: - id: 0 -# CHECK-NEXT: name: entry -# CHECK-NEXT: alignment: 0 -# CHECK-NEXT: isLandingPad: false -# CHECK-NEXT: addressTaken: false -name: foo -body: - - id: 0 - name: entry -... ---- -# CHECK: name: bar -# CHECK: body: -# CHECK-NEXT: - id: 0 -# CHECK-NEXT: name: start -# CHECK-NEXT: alignment: 4 -# CHECK-NEXT: isLandingPad: false -# CHECK-NEXT: addressTaken: false -# CHECK-NEXT: - id: 1 -# CHECK-NEXT: alignment: 0 -# CHECK-NEXT: isLandingPad: false -# CHECK-NEXT: addressTaken: true -name: bar -body: - - id: 0 - name: start - alignment: 4 - - id: 1 - addressTaken: true -... diff --git a/test/CodeGen/MIR/expected-eof-after-successor-mbb.mir b/test/CodeGen/MIR/expected-eof-after-successor-mbb.mir deleted file mode 100644 index 25ae5119297..00000000000 --- a/test/CodeGen/MIR/expected-eof-after-successor-mbb.mir +++ /dev/null @@ -1,29 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -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: - - id: 0 - name: entry - # CHECK: [[@LINE+1]]:46: expected end of string after the machine basic block reference - successors: [ '%bb.1.less', '%bb.2.exit 2' ] - - id: 1 - name: less - - id: 2 - name: exit -... diff --git a/test/CodeGen/MIR/expected-mbb-reference-for-successor-mbb.mir b/test/CodeGen/MIR/expected-mbb-reference-for-successor-mbb.mir deleted file mode 100644 index ce9192901d7..00000000000 --- a/test/CodeGen/MIR/expected-mbb-reference-for-successor-mbb.mir +++ /dev/null @@ -1,29 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -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: - - id: 0 - name: entry - # CHECK: [[@LINE+1]]:35: expected a machine basic block reference - successors: [ '%bb.1.less', '2' ] - - id: 1 - name: less - - id: 2 - name: exit -... diff --git a/test/CodeGen/MIR/frame-info.mir b/test/CodeGen/MIR/frame-info.mir deleted file mode 100644 index c5468f94f33..00000000000 --- a/test/CodeGen/MIR/frame-info.mir +++ /dev/null @@ -1,91 +0,0 @@ -# RUN: llc -start-after machine-sink -stop-after machine-sink -o /dev/null %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 -isSSA: true -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: maxCallFrameSize: 0 -# CHECK-NEXT: hasOpaqueSPAdjustment: false -# CHECK-NEXT: hasVAStart: false -# CHECK-NEXT: hasMustTailInVarArgFunc: false -# CHECK: body -frameInfo: - maxAlignment: 4 -body: - - id: 0 - name: entry -... ---- -name: test2 -isSSA: true -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: 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: - - id: 0 - name: entry -... - diff --git a/test/CodeGen/MIR/function-missing-machine-function.mir b/test/CodeGen/MIR/function-missing-machine-function.mir deleted file mode 100644 index 71b5b284534..00000000000 --- a/test/CodeGen/MIR/function-missing-machine-function.mir +++ /dev/null @@ -1,13 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s -# This test verifies that an error is reported when a MIR file has some -# function but is missing a corresponding machine function. - -# CHECK: no machine function information for function 'foo' in the MIR file - ---- | - - define i32 @foo() { - ret i32 0 - } - -... diff --git a/test/CodeGen/MIR/invalid-jump-table-kind.mir b/test/CodeGen/MIR/invalid-jump-table-kind.mir deleted file mode 100644 index 4876f795386..00000000000 --- a/test/CodeGen/MIR/invalid-jump-table-kind.mir +++ /dev/null @@ -1,54 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -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: - - id: 0 - name: entry - - id: 1 - name: entry - - id: 2 - name: def - - id: 3 - name: lbl1 - - id: 4 - name: lbl2 - - id: 5 - name: lbl3 - - id: 6 - name: lbl4 -... diff --git a/test/CodeGen/MIR/llvm-ir-error-reported.mir b/test/CodeGen/MIR/llvm-ir-error-reported.mir deleted file mode 100644 index 3508c341c44..00000000000 --- a/test/CodeGen/MIR/llvm-ir-error-reported.mir +++ /dev/null @@ -1,22 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 - } - -... diff --git a/test/CodeGen/MIR/llvmIR.mir b/test/CodeGen/MIR/llvmIR.mir deleted file mode 100644 index 3c084ad7d39..00000000000 --- a/test/CodeGen/MIR/llvmIR.mir +++ /dev/null @@ -1,37 +0,0 @@ -# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %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 -body: - - id: 0 -... diff --git a/test/CodeGen/MIR/llvmIRMissing.mir b/test/CodeGen/MIR/llvmIRMissing.mir deleted file mode 100644 index 80cea5a6fda..00000000000 --- a/test/CodeGen/MIR/llvmIRMissing.mir +++ /dev/null @@ -1,9 +0,0 @@ -# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s -# This test ensures that the MIR parser accepts files without the LLVM IR. - ---- -# CHECK: name: foo -name: foo -body: - - id: 0 -... diff --git a/test/CodeGen/MIR/machine-basic-block-expected-ir-block.mir b/test/CodeGen/MIR/machine-basic-block-expected-ir-block.mir deleted file mode 100644 index 2f3d40af792..00000000000 --- a/test/CodeGen/MIR/machine-basic-block-expected-ir-block.mir +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s - ---- | - - define i32 @foo() { - ret i32 0 - } - -... ---- -name: foo -body: - - id: 0 -# CHECK: [[@LINE+1]]:19: expected an IR block reference - ir-block: '0' -... diff --git a/test/CodeGen/MIR/machine-basic-block-ir-block-reference.mir b/test/CodeGen/MIR/machine-basic-block-ir-block-reference.mir deleted file mode 100644 index ccbab534388..00000000000 --- a/test/CodeGen/MIR/machine-basic-block-ir-block-reference.mir +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %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: id: 0 -# CHECK: ir-block: '%ir-block.0' - - id: 0 - ir-block: '%ir-block.0' -... diff --git a/test/CodeGen/MIR/machine-basic-block-redefinition-error.mir b/test/CodeGen/MIR/machine-basic-block-redefinition-error.mir deleted file mode 100644 index deac3b0b69b..00000000000 --- a/test/CodeGen/MIR/machine-basic-block-redefinition-error.mir +++ /dev/null @@ -1,17 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s - ---- | - - define i32 @foo() { - entry: - ret i32 0 - } - -... ---- -name: foo -body: - # CHECK: redefinition of machine basic block with id #0 - - id: 0 - - id: 0 -... diff --git a/test/CodeGen/MIR/machine-basic-block-undefined-ir-block.mir b/test/CodeGen/MIR/machine-basic-block-undefined-ir-block.mir deleted file mode 100644 index 76d561e61fa..00000000000 --- a/test/CodeGen/MIR/machine-basic-block-undefined-ir-block.mir +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s - ---- | - - define i32 @foo() { - ret i32 0 - } - -... ---- -name: foo -body: - - id: 0 -# CHECK: [[@LINE+1]]:19: use of undefined IR block '%ir-block.10' - ir-block: '%ir-block.10' -... diff --git a/test/CodeGen/MIR/machine-basic-block-unknown-name.mir b/test/CodeGen/MIR/machine-basic-block-unknown-name.mir deleted file mode 100644 index df8eee9d270..00000000000 --- a/test/CodeGen/MIR/machine-basic-block-unknown-name.mir +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -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+2]]:18: basic block 'entrie' is not defined in the function 'foo' - - id: 0 - name: entrie -... diff --git a/test/CodeGen/MIR/machine-function-missing-body-error.mir b/test/CodeGen/MIR/machine-function-missing-body-error.mir deleted file mode 100644 index 0dc7477f627..00000000000 --- a/test/CodeGen/MIR/machine-function-missing-body-error.mir +++ /dev/null @@ -1,15 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s -# This test ensures that the MIR parser reports an error when it encounters a -# machine function with an empty body. - ---- | - - define i32 @foo() { - ret i32 0 - } - -... ---- -# CHECK: machine function 'foo' requires at least one machine basic block in its body -name: foo -... diff --git a/test/CodeGen/MIR/machine-function-missing-function.mir b/test/CodeGen/MIR/machine-function-missing-function.mir deleted file mode 100644 index 424c34aae84..00000000000 --- a/test/CodeGen/MIR/machine-function-missing-function.mir +++ /dev/null @@ -1,23 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 -body: - - id: 0 -... ---- -# CHECK: function 'faa' isn't defined in the provided LLVM IR -name: faa -body: - - id: 0 -... diff --git a/test/CodeGen/MIR/machine-function-missing-name.mir b/test/CodeGen/MIR/machine-function-missing-name.mir deleted file mode 100644 index a868a65d35f..00000000000 --- a/test/CodeGen/MIR/machine-function-missing-name.mir +++ /dev/null @@ -1,26 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 -body: - - id: 0 -... ---- -name: bar -body: - - id: 0 -... diff --git a/test/CodeGen/MIR/machine-function-redefinition-error.mir b/test/CodeGen/MIR/machine-function-redefinition-error.mir deleted file mode 100644 index be84161b563..00000000000 --- a/test/CodeGen/MIR/machine-function-redefinition-error.mir +++ /dev/null @@ -1,10 +0,0 @@ -# RUN: not llc -start-after branch-folder -stop-after branch-folder -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 -... diff --git a/test/CodeGen/MIR/machine-function.mir b/test/CodeGen/MIR/machine-function.mir deleted file mode 100644 index afd10ab02c2..00000000000 --- a/test/CodeGen/MIR/machine-function.mir +++ /dev/null @@ -1,66 +0,0 @@ -# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %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-NEXT: hasInlineAsm: false -# CHECK: ... -name: foo -body: - - id: 0 -... ---- -# CHECK: name: bar -# CHECK-NEXT: alignment: -# CHECK-NEXT: exposesReturnsTwice: false -# CHECK-NEXT: hasInlineAsm: false -# CHECK: ... -name: bar -body: - - id: 0 -... ---- -# CHECK: name: func -# CHECK-NEXT: alignment: 8 -# CHECK-NEXT: exposesReturnsTwice: false -# CHECK-NEXT: hasInlineAsm: false -# CHECK: ... -name: func -alignment: 8 -body: - - id: 0 -... ---- -# CHECK: name: func2 -# CHECK-NEXT: alignment: 16 -# CHECK-NEXT: exposesReturnsTwice: true -# CHECK-NEXT: hasInlineAsm: true -# CHECK: ... -name: func2 -alignment: 16 -exposesReturnsTwice: true -hasInlineAsm: true -body: - - id: 0 -... diff --git a/test/CodeGen/MIR/register-info.mir b/test/CodeGen/MIR/register-info.mir deleted file mode 100644 index 9585faa9622..00000000000 --- a/test/CodeGen/MIR/register-info.mir +++ /dev/null @@ -1,40 +0,0 @@ -# RUN: llc -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s -# This test ensures that the MIR parser parses machine register info properties -# correctly. - ---- | - - define i32 @foo() { - entry: - ret i32 0 - } - - define i32 @bar() { - start: - ret i32 0 - } - -... ---- -# CHECK: name: foo -# CHECK: isSSA: false -# CHECK-NEXT: tracksRegLiveness: false -# CHECK-NEXT: tracksSubRegLiveness: false -# CHECK: ... -name: foo -body: - - id: 0 -... ---- -# CHECK: name: bar -# CHECK: isSSA: false -# CHECK-NEXT: tracksRegLiveness: true -# CHECK-NEXT: tracksSubRegLiveness: true -# CHECK: ... -name: bar -isSSA: false -tracksRegLiveness: true -tracksSubRegLiveness: true -body: - - id: 0 -...