1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/test/FileCheck/check-literal.txt
Jacques Pienaar 3733be80bf [FileCheck] Add a literal check directive modifier
Introduce CHECK modifiers that change the behavior of the CHECK
directive. Also add a LITERAL modifier for cases where matching could
end requiring escaping strings interpreted as regex where only
literal/fixed string matching is desired (making the CHECK's more
difficult to write/fragile and difficult to interpret).
2020-12-18 17:26:15 -08:00

63 lines
1.5 KiB
Plaintext

; RUN: FileCheck -check-prefix=A -input-file %s %s
;; This tests the LITERAL directive modifier.
The result is "5371, 5372, 5373, 5374"
The result is "[[[5371]], [[5372]], [[5373]], [[5374]]]"
[[[5375]], [[5376]],
[[[5377]], [[5378]],
{{there you go.*}}
[[10]]
[[20]]
[[50]]
;; These should all not match.
; A{}: 5371, 5372,
; A{LITERAL} 5371, 5372,
; A{LITERAL 5371, 5372,
; A{LITERAL,} 5371, 5372,
; A{, LITERAL} 5371, 5372,
; A: 5371, 5372,
; A-SAME: 5373, 5374
; A{LITERAL}: [[[5371]], [[5372]],
; A-SAME{LITERAL}: [[5373]], [[5374]]]
;; Modifier list allows whitespace.
; A{ LITERAL }: [[[5375]], [[5376]],
;; Modifiers are combined into a set and repetition is allowed.
; A{LITERAL , LITERAL}: [[[5377]], [[5378]],
; A-NEXT{LITERAL}: {{there you go.*}}
; A-NOT{LITERAL}: [[50]]
; A-DAG{LITERAL}: [[20]]
; A-DAG{LITERAL}: [[10]]
; A{LITERAL}: [[50]]
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=INVALID 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-INVALID
;; Ensure invalid modifier skipped.
; INVALID{BADMODIFIER}: 6371, 6372,
; CHECK-INVALID: no check strings found with prefix 'INVALID
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERRNOT 2>&1 | \
; RUN: FileCheck %s --check-prefix=ERRNOT
;; This ensures a failure is correctly reported when a NOT directive with a
;; LITERAL modifier matches.
[[a]]
[[b]]
[[c]]
; CHECK-ERRNOT{LITERAL}: [[a]]
; CHECK-ERRNOT-NOT{LITERAL}: [[b]]
; CHECK-ERRNOT{LITERAL}: [[c]]
; ERRNOT: no match expected