| 1 |
// Regression test for #139375 |
| 2 |
// Clang uses 1-based indexing for source locations given from the command-line. |
| 3 |
// Verify that `clang-refactor` rejects 0 as an invalid value for line or column number. |
| 4 |
|
| 5 |
// For range start: |
| 6 |
// RUN: not clang-refactor local-rename -selection=%s:0:1-1:1 -new-name=test %s 2>&1 \ |
| 7 |
// RUN: | FileCheck -check-prefix=CHECK-DIAG %s |
| 8 |
// RUN: not clang-refactor local-rename -selection=%s:1:0-1:1 -new-name=test %s 2>&1 \ |
| 9 |
// RUN: | FileCheck -check-prefix=CHECK-DIAG %s |
| 10 |
|
| 11 |
// For range end: |
| 12 |
// RUN: not clang-refactor local-rename -selection=%s:1:1-0:1 -new-name=test %s 2>&1 \ |
| 13 |
// RUN: | FileCheck -check-prefix=CHECK-DIAG %s |
| 14 |
// RUN: not clang-refactor local-rename -selection=%s:1:1-1:0 -new-name=test %s 2>&1 \ |
| 15 |
// RUN: | FileCheck -check-prefix=CHECK-DIAG %s |
| 16 |
|
| 17 |
// CHECK-DIAG: error: '-selection' option must be specified using <file>:<line>:<column> or <file>:<line>:<column>-<line>:<column> format, where <line> and <column> are integers greater than zero. |