44 lines · plain
1// Check near-miss mechanics:2// RUN: mlir-opt --split-input-file --verify-diagnostics %s 2> %t \3// RUN: && FileCheck --input-file %t --check-prefix=CHECK-DEFAULT %s4// RUN: cat %t5 6// Check that (1) custom input splitter and (2) custom output splitters work.7// RUN: mlir-opt %s -split-input-file="// CHECK-DEFAULT: ""----" \8// RUN: -output-split-marker="// ---- next split ----" \9// RUN: | FileCheck --check-prefix=CHECK-CUSTOM %s10 11// Check that (3) the input is not split if `-split-input-file` is not given.12// RUN: mlir-opt %s 2> %t \13// RUN: || FileCheck --input-file %t --check-prefix=CHECK-NOSPLIT %s14// RUN: cat %t15 16func.func @main() {return}17 18// -----19 20// expected-note @+1 {{see existing symbol definition here}}21func.func @foo() { return }22// CHECK-DEFAULT: warning: near miss with file split marker23// CHECK-DEFAULT: ----24// ----25 26// CHECK-NOSPLIT: error: redefinition of symbol named 'main'27func.func @main() {return}28 29// expected-error @+1 {{redefinition of symbol named 'foo'}}30func.func @foo() { return }31// CHECK-DEFAULT: warning: near miss with file split marker32// CHECK-DEFAULT: ----33// ----34func.func @bar2() {return }35 36// No error flagged at the end for a near miss.37// ----38 39// CHECK-CUSTOM: module40// CHECK-CUSTOM: ---- next split ----41// CHECK-CUSTOM: module42// CHECK-CUSTOM: ---- next split ----43// CHECK-CUSTOM: module44