115 lines · plain
1;2; Basic error checking.3;4 5this is something else6 7; RUN: %ProtectFileCheckOutput \8; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR1 2>&1 \9; RUN: | FileCheck %s --check-prefix=ERRCOUNT110CHECK-ERR1-COUNT-xx: this11ERRCOUNT1: [[@LINE-1]]:18: error: invalid count in -COUNT specification on prefix 'CHECK-ERR1'12 13; RUN: %ProtectFileCheckOutput \14; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR2 2>&1 \15; RUN: | FileCheck %s --check-prefix=ERRCOUNT216CHECK-ERR2-COUNT-0x1: something17ERRCOUNT2: [[@LINE-1]]:19: error: invalid count in -COUNT specification on prefix 'CHECK-ERR2'18 19; RUN: %ProtectFileCheckOutput \20; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR3 2>&1 \21; RUN: | FileCheck %s --check-prefix=ERRCOUNT322CHECK-ERR3-COUNT-100x: else23ERRCOUNT3: [[@LINE-1]]:21: error: invalid count in -COUNT specification on prefix 'CHECK-ERR3'24 25; RUN: %ProtectFileCheckOutput \26; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR4 2>&1 \27; RUN: | FileCheck %s --check-prefix=ERRCOUNT428CHECK-ERR4-COUNT-0: else29ERRCOUNT4: [[@LINE-1]]:19: error: invalid count in -COUNT specification on prefix 'CHECK-ERR4'30 31;32; Main functionality33;34 35this is duplicate36this is duplicate37this is not duplicate38this is duplicate39this is duplicate40this is duplicate41 42; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT143CHECK-CNT1-COUNT-1: this is duplicate44CHECK-CNT1: this is duplicate45CHECK-CNT1-NEXT: this is not duplicate46 47; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT248CHECK-CNT2-COUNT-2: this is duplicate49CHECK-CNT2: this is not duplicate50 51; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT352CHECK-CNT3-COUNT-2: this is duplicate53CHECK-CNT3: this is not duplicate54CHECK-CNT3-COUNT-3: this is duplicate55CHECK-CNT3-NOT: {{^}}this is duplicate56 57; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT458CHECK-CNT4-COUNT-5: this is duplicate59CHECK-CNT4-EMPTY:60 61Many-label:62 63-many-64-many-65-many-66-many-67-many-68-many-69-many-70-many-71-many-72-many-73-many-74-many-75-many-76-many-77-many-78-many-79 80; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNTMANY81CHECK-CNTMANY-COUNT-2: this is duplicate82CHECK-CNTMANY-LABEL: Many-label:83CHECK-CNTMANY-EMPTY:84CHECK-CNTMANY-COUNT-16: {{^}}-many-85CHECK-CNTMANY-EMPTY:86 87;88; Tests on mismatches:89;90 91; RUN: %ProtectFileCheckOutput \92; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS1 2>&1 \93; RUN: | FileCheck %s --check-prefix=MISCOUNT194CHECK-MIS1-COUNT-3: this is duplicate95CHECK-MIS1: {{^}}this is not duplicate96MISCOUNT1: [[@LINE-1]]:13: error: CHECK-MIS1: expected string not found in input97 98; RUN: %ProtectFileCheckOutput \99; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS2 2>&1 \100; RUN: | FileCheck %s --check-prefix=MISCOUNT2101CHECK-MIS2-COUNT-10: {{^this is duplicate}}102CHECK-MIS2: {{^}}this is not duplicate103MISCOUNT2: [[@LINE-2]]:22: error: CHECK-MIS2-COUNT: expected string not found in input104 105; RUN: %ProtectFileCheckOutput \106; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS3 2>&1 \107; RUN: | FileCheck %s --check-prefix=MISCOUNT3108CHECK-MIS3-COUNT-5: this is duplicate109CHECK-MIS3-EMPTY:110CHECK-MIS3-LABEL: Many-label:111CHECK-MIS3-EMPTY:112CHECK-MIS3-COUNT-160: {{^}}-many-113CHECK-MIS3-EMPTY:114MISCOUNT3: [[@LINE-2]]:23: error: CHECK-MIS3-COUNT: expected string not found in input (17 out of 160)115