Fedor Sergeev | 162ad1b | 2018-11-13 00:46:13 +0000 | [diff] [blame] | 1 | ; |
| 2 | ; Basic error checking. |
| 3 | ; |
| 4 | |
| 5 | this is something else |
| 6 | |
| 7 | ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR1 2>&1 | FileCheck %s --check-prefix=ERRCOUNT1 |
| 8 | CHECK-ERR1-COUNT-xx: this |
| 9 | ERRCOUNT1: [[@LINE-1]]:18: error: invalid count in -COUNT specification on prefix 'CHECK-ERR1' |
| 10 | |
| 11 | ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR2 2>&1 | FileCheck %s --check-prefix=ERRCOUNT2 |
| 12 | CHECK-ERR2-COUNT-0x1: something |
| 13 | ERRCOUNT2: [[@LINE-1]]:19: error: invalid count in -COUNT specification on prefix 'CHECK-ERR2' |
| 14 | |
| 15 | ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR3 2>&1 | FileCheck %s --check-prefix=ERRCOUNT3 |
| 16 | CHECK-ERR3-COUNT-100x: else |
| 17 | ERRCOUNT3: [[@LINE-1]]:21: error: invalid count in -COUNT specification on prefix 'CHECK-ERR3' |
| 18 | |
| 19 | ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR4 2>&1 | FileCheck %s --check-prefix=ERRCOUNT4 |
| 20 | CHECK-ERR4-COUNT-0: else |
| 21 | ERRCOUNT4: [[@LINE-1]]:19: error: invalid count in -COUNT specification on prefix 'CHECK-ERR4' |
| 22 | |
| 23 | ; |
| 24 | ; Main functionality |
| 25 | ; |
| 26 | |
| 27 | this is duplicate |
| 28 | this is duplicate |
| 29 | this is not duplicate |
| 30 | this is duplicate |
| 31 | this is duplicate |
| 32 | this is duplicate |
| 33 | |
| 34 | ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT1 |
| 35 | CHECK-CNT1-COUNT-1: this is duplicate |
| 36 | CHECK-CNT1: this is duplicate |
| 37 | CHECK-CNT1-NEXT: this is not duplicate |
| 38 | |
| 39 | ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT2 |
| 40 | CHECK-CNT2-COUNT-2: this is duplicate |
| 41 | CHECK-CNT2: this is not duplicate |
| 42 | |
| 43 | ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT3 |
| 44 | CHECK-CNT3-COUNT-2: this is duplicate |
| 45 | CHECK-CNT3: this is not duplicate |
| 46 | CHECK-CNT3-COUNT-3: this is duplicate |
| 47 | CHECK-CNT3-NOT: {{^}}this is duplicate |
| 48 | |
| 49 | ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT4 |
| 50 | CHECK-CNT4-COUNT-5: this is duplicate |
| 51 | CHECK-CNT4-EMPTY: |
| 52 | |
| 53 | Many-label: |
| 54 | |
| 55 | -many- |
| 56 | -many- |
| 57 | -many- |
| 58 | -many- |
| 59 | -many- |
| 60 | -many- |
| 61 | -many- |
| 62 | -many- |
| 63 | -many- |
| 64 | -many- |
| 65 | -many- |
| 66 | -many- |
| 67 | -many- |
| 68 | -many- |
| 69 | -many- |
| 70 | -many- |
| 71 | |
| 72 | ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNTMANY |
| 73 | CHECK-CNTMANY-COUNT-2: this is duplicate |
| 74 | CHECK-CNTMANY-LABEL: Many-label: |
| 75 | CHECK-CNTMANY-EMPTY: |
| 76 | CHECK-CNTMANY-COUNT-16: {{^}}-many- |
| 77 | CHECK-CNTMANY-EMPTY: |
| 78 | |
| 79 | ; |
| 80 | ; Tests on mismatches: |
| 81 | ; |
| 82 | |
| 83 | ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS1 2>&1 | FileCheck %s --check-prefix=MISCOUNT1 |
| 84 | CHECK-MIS1-COUNT-3: this is duplicate |
| 85 | CHECK-MIS1: {{^}}this is not duplicate |
| 86 | MISCOUNT1: [[@LINE-1]]:13: error: CHECK-MIS1: expected string not found in input |
| 87 | |
| 88 | ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS2 2>&1 | FileCheck %s --check-prefix=MISCOUNT2 |
| 89 | CHECK-MIS2-COUNT-10: {{^this is duplicate}} |
| 90 | CHECK-MIS2: {{^}}this is not duplicate |
| 91 | MISCOUNT2: [[@LINE-2]]:22: error: CHECK-MIS2-COUNT: expected string not found in input |
| 92 | |
| 93 | ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS3 2>&1 | FileCheck %s --check-prefix=MISCOUNT3 |
| 94 | CHECK-MIS3-COUNT-5: this is duplicate |
| 95 | CHECK-MIS3-EMPTY: |
| 96 | CHECK-MIS3-LABEL: Many-label: |
| 97 | CHECK-MIS3-EMPTY: |
| 98 | CHECK-MIS3-COUNT-160: {{^}}-many- |
| 99 | CHECK-MIS3-EMPTY: |
| 100 | MISCOUNT3: [[@LINE-2]]:23: error: CHECK-MIS3-COUNT: expected string not found in input (17 out of 160) |