|
1 |
| -// Check that PS4 clang doesn't report a warning message when locating |
2 |
| -// system header files (either by looking at the value of SCE_ORBIS_SDK_DIR |
3 |
| -// or relative to the location of the compiler driver), if "-nostdinc", |
4 |
| -// "--sysroot" or "-isysroot" option is specified on the command line. |
5 |
| -// Otherwise, check that PS4 clang reports a warning. |
6 |
| - |
7 |
| -// Check that PS4 clang doesn't report a warning message when locating |
8 |
| -// system libraries (either by looking at the value of SCE_ORBIS_SDK_DIR |
9 |
| -// or relative to the location of the compiler driver), if "-c", "-S", "-E" |
10 |
| -// or "--sysroot" option is specified on the command line. |
11 |
| -// Otherwise, check that PS4 clang reports a warning. |
12 |
| - |
13 |
| -// Setting up SCE_ORBIS_SDK_DIR to existing location, which is not a PS4 SDK. |
14 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-SYS-HEADERS -check-prefix=WARN-SYS-LIBS -check-prefix=NO-WARN %s |
15 |
| - |
16 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -c -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-SYS-HEADERS -check-prefix=NO-WARN %s |
17 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -S -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-SYS-HEADERS -check-prefix=NO-WARN %s |
18 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -E -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-SYS-HEADERS -check-prefix=NO-WARN %s |
19 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -emit-ast -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-SYS-HEADERS -check-prefix=NO-WARN %s |
20 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -isysroot foo -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-ISYSROOT -check-prefix=WARN-SYS-LIBS -check-prefix=NO-WARN %s |
21 |
| - |
22 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -c -nostdinc -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
23 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -S -nostdinc -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
24 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -E -nostdinc -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
25 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -emit-ast -nostdinc -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
26 |
| - |
27 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -c --sysroot=foo/ -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
28 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -S --sysroot=foo/ -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
29 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -E --sysroot=foo/ -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
30 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -emit-ast --sysroot=foo/ -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
31 |
| - |
32 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -c -isysroot foo -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-ISYSROOT -check-prefix=NO-WARN %s |
33 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -S -isysroot foo -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-ISYSROOT -check-prefix=NO-WARN %s |
34 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -E -isysroot foo -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-ISYSROOT -check-prefix=NO-WARN %s |
35 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -emit-ast -isysroot foo -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-ISYSROOT -check-prefix=NO-WARN %s |
36 |
| -// RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### --sysroot=foo/ -isysroot foo -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-ISYSROOT -check-prefix=NO-WARN %s |
| 1 | +/// PS4 clang emits warnings when SDK headers (<SDKROOT>/target/include/) or |
| 2 | +/// libraries (<SDKROOT>/target/lib/) are missing, unless the user takes control |
| 3 | +/// of search paths, when corresponding existence checks are skipped. |
| 4 | +/// |
| 5 | +/// User control of header search is assumed if `--sysroot`, `-isysroot`, |
| 6 | +/// `-nostdinc` or `-nostdlibinc` is supplied. User control of library search |
| 7 | +/// is assumed if `--sysroot` is supplied. |
| 8 | +/// |
| 9 | +/// Warnings are emitted if a specified `-isysroot` or `--sysroot` does not |
| 10 | +/// exist. |
| 11 | +/// |
| 12 | +/// The default <SDKROOT> for both headers and libraries is taken from the |
| 13 | +/// SCE_ORBIS_SDK_DIR environment variable. |
| 14 | + |
| 15 | +// RUN: echo "-### -Winvalid-or-nonexistent-directory -target x86_64-scei-ps4" > %t.rsp |
| 16 | + |
| 17 | +/// If SDK headers and/or libraries are found, associated warnings are absent. |
| 18 | +// RUN: rm -rf %t.inconly && mkdir -p %t.inconly/target/include |
| 19 | +// RUN: env SCE_ORBIS_SDK_DIR=%t.inconly %clang @%t.rsp %s 2>&1 | FileCheck -check-prefixes=WARN-SYS-LIBS,NO-WARN %s |
| 20 | + |
| 21 | +// RUN: rm -rf %t.libonly && mkdir -p %t.libonly/target/lib |
| 22 | +// RUN: env SCE_ORBIS_SDK_DIR=%t.libonly %clang @%t.rsp %s 2>&1 | FileCheck -check-prefixes=WARN-SYS-HEADERS,NO-WARN %s |
| 23 | + |
| 24 | +// RUN: rm -rf %t.both && mkdir -p %t.both/target/lib && mkdir %t.both/target/include |
| 25 | +// RUN: env SCE_ORBIS_SDK_DIR=%t.both %clang @%t.rsp %s 2>&1 | FileCheck -check-prefix=NO-WARN %s |
| 26 | + |
| 27 | +/// In the following invocations, SCE_ORBIS_SDK_DIR is set to an existing |
| 28 | +/// location where SDK headers and libraries are absent. |
| 29 | + |
| 30 | +/// When compiling and linking, we should see a warnings about both missing |
| 31 | +/// headers and libraries. |
| 32 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s 2>&1 | FileCheck -check-prefixes=WARN-SYS-HEADERS,WARN-SYS-LIBS,NO-WARN %s |
| 33 | + |
| 34 | +/// If `-c`, `-S`, `-E` or `-emit-ast` is supplied, the existence check for SDK |
| 35 | +/// libraries is skipped because no linking will be performed. We only expect |
| 36 | +/// warnings about missing headers. |
| 37 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -c 2>&1 | FileCheck -check-prefixes=WARN-SYS-HEADERS,NO-WARN %s |
| 38 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -S 2>&1 | FileCheck -check-prefixes=WARN-SYS-HEADERS,NO-WARN %s |
| 39 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -E 2>&1 | FileCheck -check-prefixes=WARN-SYS-HEADERS,NO-WARN %s |
| 40 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -emit-ast 2>&1 | FileCheck -check-prefixes=WARN-SYS-HEADERS,NO-WARN %s |
| 41 | + |
| 42 | +/// If the user takes control of include paths, the existence check for headers |
| 43 | +/// is not performed. |
| 44 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -c -nostdinc 2>&1 | FileCheck -check-prefix=NO-WARN %s |
| 45 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -c -nostdlibinc 2>&1 | FileCheck -check-prefix=NO-WARN %s |
| 46 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -c -isysroot . 2>&1 | FileCheck -check-prefixes=NO-WARN %s |
| 47 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -c --sysroot=. 2>&1 | FileCheck -check-prefixes=NO-WARN %s |
| 48 | + |
| 49 | +/// --sysroot disables the existence check for libraries and headers. |
| 50 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s --sysroot=. 2>&1 | FileCheck -check-prefix=NO-WARN %s |
| 51 | + |
| 52 | +/// -isysroot overrides --sysroot for header search, but not library search. |
| 53 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -isysroot . --sysroot=.. 2>&1 | FileCheck -check-prefixes=ISYSTEM,NO-WARN %s |
| 54 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s --sysroot=.. -isysroot . 2>&1 | FileCheck -check-prefixes=ISYSTEM,NO-WARN %s |
| 55 | + |
| 56 | +/// Warnings are emitted if non-existent --sysroot/-isysroot are supplied. |
| 57 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s --sysroot=foo -isysroot . 2>&1 | FileCheck -check-prefixes=WARN-SYSROOT,NO-WARN %s |
| 58 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s -isysroot foo --sysroot=. 2>&1 | FileCheck -check-prefixes=WARN-SYSROOT,NO-WARN %s |
| 59 | +// RUN: env SCE_ORBIS_SDK_DIR=.. %clang @%t.rsp %s --sysroot=foo -isysroot bar 2>&1 | FileCheck -check-prefixes=WARN-SYSROOT,WARN-SYSROOT2,NO-WARN %s |
37 | 60 |
|
38 | 61 | // NO-WARN-NOT: {{warning:|error:}}
|
39 |
| -// WARN-SYS-HEADERS: warning: unable to find PS4 system headers directory |
40 |
| -// WARN-ISYSROOT: warning: no such sysroot directory: 'foo' |
41 | 62 | // WARN-SYS-LIBS: warning: unable to find PS4 system libraries directory
|
| 63 | +// WARN-SYS-HEADERS: warning: unable to find PS4 system headers directory |
| 64 | +// WARN-SYSROOT: warning: no such sysroot directory: 'foo' |
| 65 | +// WARN-SYSROOT2: warning: no such sysroot directory: 'bar' |
42 | 66 | // NO-WARN-NOT: {{warning:|error:}}
|
| 67 | +// ISYSTEM: "-cc1"{{.*}}"-internal-externc-isystem" "./target/include" |
0 commit comments