1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/FileCheck/implicit-check-not.txt
Alexander Kornienko 602ce0f496 Add FileCheck -implicit-check-not option to allow stricter tests without adding too many CHECK-NOTs manually.
Summary:
Add FileCheck -implicit-check-not option which allows specifying a
pattern that should only occur in the input when explicitly matched by a
positive check. This feature allows checking tool diagnostics in a way
clang -verify does it for compiler diagnostics.

The option has been tested on a number of clang-tidy checks, I'll post a link to
the clang-tidy patch to this thread.

Once there's an agreement on the general direction, I can add tests and
documentation.

Reviewers: djasper, bkramer

Reviewed By: bkramer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D4462

llvm-svn: 212810
2014-07-11 12:39:32 +00:00

45 lines
2.8 KiB
Plaintext

; RUN: sed 's#^;.*##' %s | FileCheck -check-prefix=CHECK-PASS -implicit-check-not=warning: %s
; RUN: sed 's#^;.*##' %s | not FileCheck -check-prefix=CHECK-FAIL1 -implicit-check-not=warning: %s 2>&1 | FileCheck %s -check-prefix CHECK-ERROR1
; RUN: sed 's#^;.*##' %s | not FileCheck -check-prefix=CHECK-FAIL2 -implicit-check-not=warning: %s 2>&1 | FileCheck %s -check-prefix CHECK-ERROR2
; RUN: sed 's#^;.*##' %s | not FileCheck -check-prefix=CHECK-FAIL3 -implicit-check-not=warning: %s 2>&1 | FileCheck %s -check-prefix CHECK-ERROR3
; RUN: sed 's#^;.*##' %s | not FileCheck -check-prefix=CHECK-FAIL1 -implicit-check-not='{{aaa|bbb|ccc}}' %s 2>&1 | FileCheck %s -check-prefix CHECK-ERROR4
; RUN: sed 's#^;.*##' %s | not FileCheck -check-prefix=CHECK-FAIL1 -implicit-check-not=aaa -implicit-check-not=bbb -implicit-check-not=ccc %s 2>&1 | FileCheck %s -check-prefix CHECK-ERROR5
; RUN: sed 's#^;.*##' %s | not FileCheck -check-prefix=CHECK-FAIL2 -implicit-check-not=aaa -implicit-check-not=bbb -implicit-check-not=ccc %s 2>&1 | FileCheck %s -check-prefix CHECK-ERROR6
; RUN: sed 's#^;.*##' %s | not FileCheck -check-prefix=CHECK-FAIL3 -implicit-check-not=aaa -implicit-check-not=bbb -implicit-check-not=ccc %s 2>&1 | FileCheck %s -check-prefix CHECK-ERROR7
warning: aaa
; CHECK-PASS: warning: aaa
; CHECK-ERROR1: error: CHECK-FAIL1-NOT: string occurred!
; CHECK-ERROR1: command line:1:22: note: CHECK-FAIL1-NOT: pattern specified here
; CHECK-ERROR1-NEXT: -implicit-check-not='warning:'
; CHECK-FAIL2: warning: aaa
; CHECK-FAIL3: warning: aaa
; CHECK-ERROR4: error: CHECK-FAIL1-NOT: string occurred!
; CHECK-ERROR4: command line:1:22: note: CHECK-FAIL1-NOT: pattern specified here
; CHECK-ERROR4-NEXT: {{-implicit-check-not='\{\{aaa\|bbb\|ccc\}\}'}}
; CHECK-ERROR5: error: CHECK-FAIL1-NOT: string occurred!
; CHECK-ERROR5: command line:1:22: note: CHECK-FAIL1-NOT: pattern specified here
; CHECK-ERROR5-NEXT: -implicit-check-not='aaa'
warning: bbb
; CHECK-PASS: warning: bbb
; CHECK-FAIL1: warning: bbb
; CHECK-ERROR2: error: CHECK-FAIL2-NOT: string occurred!
; CHECK-ERROR2: command line:1:22: note: CHECK-FAIL2-NOT: pattern specified here
; CHECK-ERROR2-NEXT: -implicit-check-not='warning:'
; CHECK-FAIL3: warning: bbb
; CHECK-ERROR6: error: CHECK-FAIL2-NOT: string occurred!
; CHECK-ERROR6: command line:1:22: note: CHECK-FAIL2-NOT: pattern specified here
; CHECK-ERROR6-NEXT: -implicit-check-not='bbb'
warning: ccc
; CHECK-PASS: warning: ccc
; CHECK-FAIL1: warning: ccc
; CHECK-FAIL2: warning: ccc
; CHECK-ERROR3: error: CHECK-FAIL3-NOT: string occurred!
; CHECK-ERROR3: command line:1:22: note: CHECK-FAIL3-NOT: pattern specified here
; CHECK-ERROR3-NEXT: -implicit-check-not='warning:'
; CHECK-ERROR7: error: CHECK-FAIL3-NOT: string occurred!
; CHECK-ERROR7: command line:1:22: note: CHECK-FAIL3-NOT: pattern specified here
; CHECK-ERROR7-NEXT: -implicit-check-not='ccc'