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 %s 4// RUN: cat %t 5 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 %s 10 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 %s 14// RUN: cat %t 15 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 marker 23// 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 marker 32// CHECK-DEFAULT: ---- 33// ---- 34func.func @bar2() {return } 35 36// No error flagged at the end for a near miss. 37// ---- 38 39// CHECK-CUSTOM: module 40// CHECK-CUSTOM: ---- next split ---- 41// CHECK-CUSTOM: module 42// CHECK-CUSTOM: ---- next split ---- 43// CHECK-CUSTOM: module 44