|
1 | 1 | // Check near-miss mechanics: |
2 | 2 | // RUN: mlir-opt --split-input-file --verify-diagnostics %s 2> %t \ |
3 | | -// RUN: && FileCheck --input-file %t %s |
| 3 | +// RUN: && FileCheck --input-file %t --check-prefix=CHECK-DEFAULT %s |
4 | 4 | // RUN: cat %t |
5 | 5 |
|
6 | 6 | // Check that (1) custom input splitter and (2) custom output splitters work. |
7 | | -// RUN: mlir-opt %s -split-input-file="// CHECK: ""----" \ |
| 7 | +// RUN: mlir-opt %s -split-input-file="// CHECK-DEFAULT: ""----" \ |
8 | 8 | // RUN: -output-split-marker="// ---- next split ----" \ |
9 | | -// RUN: | FileCheck --check-prefix=CHECK-SPLITTERS %s |
| 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 |
10 | 15 |
|
11 | 16 | func.func @main() {return} |
12 | 17 |
|
13 | 18 | // ----- |
14 | 19 |
|
15 | 20 | // expected-note @+1 {{see existing symbol definition here}} |
16 | 21 | func.func @foo() { return } |
17 | | -// CHECK: warning: near miss with file split marker |
18 | | -// CHECK: ---- |
| 22 | +// CHECK-DEFAULT: warning: near miss with file split marker |
| 23 | +// CHECK-DEFAULT: ---- |
19 | 24 | // ---- |
20 | 25 |
|
| 26 | +// CHECK-NOSPLIT: error: redefinition of symbol named 'main' |
| 27 | +func.func @main() {return} |
| 28 | + |
21 | 29 | // expected-error @+1 {{redefinition of symbol named 'foo'}} |
22 | 30 | func.func @foo() { return } |
23 | | -// CHECK: warning: near miss with file split marker |
24 | | -// CHECK: ---- |
| 31 | +// CHECK-DEFAULT: warning: near miss with file split marker |
| 32 | +// CHECK-DEFAULT: ---- |
25 | 33 | // ---- |
26 | 34 | func.func @bar2() {return } |
27 | 35 |
|
28 | 36 | // No error flagged at the end for a near miss. |
29 | 37 | // ---- |
30 | 38 |
|
31 | | -// CHECK-SPLITTERS: module |
32 | | -// CHECK-SPLITTERS: ---- next split ---- |
33 | | -// CHECK-SPLITTERS: module |
34 | | -// CHECK-SPLITTERS: ---- next split ---- |
35 | | -// CHECK-SPLITTERS: module |
| 39 | +// CHECK-CUSTOM: module |
| 40 | +// CHECK-CUSTOM: ---- next split ---- |
| 41 | +// CHECK-CUSTOM: module |
| 42 | +// CHECK-CUSTOM: ---- next split ---- |
| 43 | +// CHECK-CUSTOM: module |
0 commit comments