llvm-project/clang/test/Driver/response-file-errs.c
Sean Perry 83368191a2
Use %errc to get text for system errors (#109852)
Several lit tests look for messages with text generated from strerror()
such as "no such file or directory". The value can change slightly from
system to system. Use the llvm-lit macro `%errc_<ERRCODE>` instead.

This was really noticable on z/OS because the generated text includes an
error code as well as the text.
2024-09-26 14:11:29 -04:00

16 lines
649 B
C

// If response file does not exist, '@file; directive remains unexpanded in
// command line.
//
// RUN: not %clang @%S/Inputs/inexistent.rsp -### 2>&1 | FileCheck --check-prefix=INEXISTENT %s
// INEXISTENT: @{{.*}}Inputs/inexistent.rsp
// As the above case but '@file' is in response file.
//
// RUN: not %clang @%S/Inputs/inc-inexistent.rsp -### 2>&1 | FileCheck --check-prefix=INEXISTENT2 %s
// INEXISTENT2: @{{.*}}inexistent.txt
// If file in `@file` is a directory, it is an error.
//
// RUN: not %clang @%S/Inputs -### 2>&1 | FileCheck -DMSG=%errc_EISDIR --check-prefix=DIRECTORY %s
// DIRECTORY: cannot not open file '{{.*}}Inputs': [[MSG]]