| 1 |
//--- '--config' must be followed by config file name. |
| 2 |
// |
| 3 |
// RUN: not %clang --config 2>&1 | FileCheck %s -check-prefix CHECK-MISSING-FILE |
| 4 |
// CHECK-MISSING-FILE: argument to '--config' is missing (expected 1 value) |
| 5 |
|
| 6 |
|
| 7 |
//--- Argument of '--config' must be existing file, if it is specified by path. |
| 8 |
// |
| 9 |
// RUN: not %clang --config somewhere/nonexistent-config-file 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix CHECK-NONEXISTENT |
| 10 |
// CHECK-NONEXISTENT: configuration file '{{.*}}somewhere{{.}}nonexistent-config-file' cannot be opened: [[MSG]] |
| 11 |
|
| 12 |
|
| 13 |
//--- All '--config' arguments must be existing files. |
| 14 |
// |
| 15 |
// RUN: not %clang --config %S/Inputs/config-4.cfg --config somewhere/nonexistent-config-file 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix CHECK-NONEXISTENT |
| 16 |
|
| 17 |
|
| 18 |
//--- Argument of '--config' must exist somewhere in well-known directories, if it is specified by bare name. |
| 19 |
// |
| 20 |
// RUN: not %clang --config-system-dir= --config-user-dir= --config nonexistent-config-file.cfg 2>&1 | FileCheck %s -check-prefix CHECK-NOTFOUND0 |
| 21 |
// CHECK-NOTFOUND0: configuration file 'nonexistent-config-file.cfg' cannot be found |
| 22 |
// CHECK-NOTFOUND0-NEXT: was searched for in the directory: |
| 23 |
// CHECK-NOTFOUND0-NOT: was searched for in the directory: |
| 24 |
// |
| 25 |
// RUN: not %clang --config-system-dir= --config-user-dir=%S/Inputs/config2 --config nonexistent-config-file.cfg 2>&1 | FileCheck %s -check-prefix CHECK-NOTFOUND1 |
| 26 |
// CHECK-NOTFOUND1: configuration file 'nonexistent-config-file.cfg' cannot be found |
| 27 |
// CHECK-NOTFOUND1-NEXT: was searched for in the directory: {{.*}}/Inputs/config2 |
| 28 |
// CHECK-NOTFOUND1-NEXT: was searched for in the directory: |
| 29 |
// CHECK-NOTFOUND1-NOT: was searched for in the directory: |
| 30 |
// |
| 31 |
// RUN: not %clang --config-system-dir=%S/Inputs/config --config-user-dir= --config nonexistent-config-file.cfg 2>&1 | FileCheck %s -check-prefix CHECK-NOTFOUND2 |
| 32 |
// CHECK-NOTFOUND2: configuration file 'nonexistent-config-file.cfg' cannot be found |
| 33 |
// CHECK-NOTFOUND2-NEXT: was searched for in the directory: {{.*}}/Inputs/config |
| 34 |
// CHECK-NOTFOUND2-NEXT: was searched for in the directory: |
| 35 |
// CHECK-NOTFOUND2-NOT: was searched for in the directory: |
| 36 |
// |
| 37 |
// RUN: not %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config nonexistent-config-file.cfg 2>&1 | FileCheck %s -check-prefix CHECK-NOTFOUND3 |
| 38 |
// CHECK-NOTFOUND3: configuration file 'nonexistent-config-file.cfg' cannot be found |
| 39 |
// CHECK-NOTFOUND3-NEXT: was searched for in the directory: {{.*}}/Inputs/config2 |
| 40 |
// CHECK-NOTFOUND3-NEXT: was searched for in the directory: {{.*}}/Inputs/config |
| 41 |
// CHECK-NOTFOUND3-NEXT: was searched for in the directory: |
| 42 |
|
| 43 |
|
| 44 |
//--- Argument in config file cannot cross the file boundary |
| 45 |
// |
| 46 |
// RUN: not %clang --config %S/Inputs/config-5.cfg x86_64-unknown-linux-gnu -c %s 2>&1 | FileCheck %s -check-prefix CHECK-CROSS |
| 47 |
// CHECK-CROSS: error: argument to '-target' is missing |