1; RUN: FileCheck -input-file %s %s
2; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD1 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR1 %s
3; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD2 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR2 %s
4; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD3 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR3 %s
5; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD4 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR4 %s
6; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD5 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR5 %s
7; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD6 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR6 %s
8; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD7 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR7 %s
9; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD8 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR8 %s
10; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD9 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR9 %s
11; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD10 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR10 %s
12; RUN: %ProtectFileCheckOutput not FileCheck -check-prefix BAD11 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR11 %s
1313
1414 aaa
1515 bbb
1616 ccc
1717 CHECK: [[@LINE-3]] {{a}}aa
1818 CHECK: [[@LINE-3]] {{b}}bb
1919 CHECK: [[@LINE-3]] {{c}}cc
2020 foobar
2121 CHECK: [[@LINE-1]] {{foo}}bar
2222
2323 arst CHECK: [[@LINE]] {{a}}rst
2424
2525 BAD1: [[@LINE:cant-have-regex]]
2626 ERR1: line-count.txt:[[#@LINE-1]]:12: error: invalid name in string variable definition
2727
2828 BAD2: [[ @LINE]]
2929 ERR2: line-count.txt:[[#@LINE-1]]:12: error: unexpected whitespace
3030
3131 BAD3: [[@LINE ]]
3232 ERR3: line-count.txt:[[#@LINE-1]]:17: error: unexpected whitespace
3333
3434 BAD4: [[ @LINE-1]]
3535 ERR4: line-count.txt:[[#@LINE-1]]:12: error: unexpected whitespace
3636
3737 BAD5: [[@LINE -1]]
3838 ERR5: line-count.txt:[[#@LINE-1]]:17: error: unexpected whitespace
3939
4040 BAD6: [[@LINE- 1]]
4141 ERR6: line-count.txt:[[#@LINE-1]]:18: error: unexpected whitespace
4242
4343 BAD7: [[@LINE-1 ]]
4444 ERR7: line-count.txt:[[#@LINE-1]]:19: error: unexpected whitespace
4545
4646 BAD8: [[@LIN]]
4747 ERR8: line-count.txt:[[#@LINE-1]]:12: error: invalid pseudo numeric variable '@LIN'
4848
4949 BAD9: [[@LINE*2]]
5050 ERR9: line-count.txt:[[#@LINE-1]]:17: error: unsupported operation '*'
5151
5252 BAD10: [[@LINE-x]]
5353 ERR10: line-count.txt:[[#@LINE-1]]:19: error: invalid operand format
5454 ERR10-NEXT: 52 {{B}}AD10: {{\[\[@LINE-x\]\]}}
5555 ERR10-NEXT:        {{^}}              ^{{$}}
5656
5757 BAD11: [[@LINE-1x]]
5858 ERR11: line-count.txt:[[#@LINE-1]]:20: error: unexpected characters at end of expression 'x'
5959
60; RUN: %ProtectFileCheckOutput \
61; RUN: not FileCheck -check-prefix BAD12 -input-file %s %s 2>&1 \
62; RUN:   | FileCheck -check-prefix ERR12 %s
6363
6464 BAD12: [[#@LINE-1]] NOT HERE
6565 ERR12: note: with "@LINE-1" equal to "63"
6666
67; RUN: %ProtectFileCheckOutput \
68; RUN: not FileCheck --check-prefix BAD13 --input-file %s %s 2>&1 \
69; RUN:   | FileCheck --check-prefix ERR13 %s
7070
7171 BAD13: [[@LINE-0xA]]
7272 ERR13: line-count.txt:[[#@LINE-1]]:20: error: unexpected characters at end of expression 'xA'
7373
7474 CHECK: [[#@LINE]] CHECK
7575 CHECK: [[# @LINE]] CHECK
7676 CHECK: [[# @LINE ]] CHECK
7777
7878 CHECK: [[#@LINE-1]]
7979 CHECK: [[# @LINE-1]] CHECK
8080 CHECK: [[# @LINE -1]] CHECK
8181 CHECK: [[# @LINE - 1]] CHECK
8282 CHECK: [[# @LINE - 1 ]] CHECK
83