Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 1 | // REQUIRES: x86-registered-target |
| 2 | |
Paul Robinson | 0531e3d | 2016-05-18 15:35:58 +0000 | [diff] [blame] | 3 | // Check that PS4 clang doesn't report a warning message when locating |
Paul Robinson | 9d61361 | 2016-05-16 17:22:25 +0000 | [diff] [blame] | 4 | // system header files (either by looking at the value of SCE_ORBIS_SDK_DIR |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 5 | // or relative to the location of the compiler driver), if "-nostdinc", |
| 6 | // "--sysroot" or "-isysroot" option is specified on the command line. |
Paul Robinson | 0531e3d | 2016-05-18 15:35:58 +0000 | [diff] [blame] | 7 | // Otherwise, check that PS4 clang reports a warning. |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 8 | |
Paul Robinson | 0531e3d | 2016-05-18 15:35:58 +0000 | [diff] [blame] | 9 | // Check that PS4 clang doesn't report a warning message when locating |
Paul Robinson | 9d61361 | 2016-05-16 17:22:25 +0000 | [diff] [blame] | 10 | // system libraries (either by looking at the value of SCE_ORBIS_SDK_DIR |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 11 | // or relative to the location of the compiler driver), if "-c", "-S", "-E", |
| 12 | // "--sysroot", "-nostdlib" or "-nodefaultlibs" option is specified on |
| 13 | // the command line. |
Paul Robinson | 0531e3d | 2016-05-18 15:35:58 +0000 | [diff] [blame] | 14 | // Otherwise, check that PS4 clang reports a warning. |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 15 | |
Paul Robinson | 0531e3d | 2016-05-18 15:35:58 +0000 | [diff] [blame] | 16 | // Setting up SCE_ORBIS_SDK_DIR to existing location, which is not a PS4 SDK. |
Paul Robinson | 9d61361 | 2016-05-16 17:22:25 +0000 | [diff] [blame] | 17 | // 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 |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 18 | |
Paul Robinson | 9d61361 | 2016-05-16 17:22:25 +0000 | [diff] [blame] | 19 | // 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 |
| 20 | // 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 |
| 21 | // 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 |
| 22 | // 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 |
| 23 | // 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 |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 24 | |
Paul Robinson | 9d61361 | 2016-05-16 17:22:25 +0000 | [diff] [blame] | 25 | // 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 |
| 26 | // 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 |
| 27 | // 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 |
| 28 | // 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 |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 29 | |
Paul Robinson | 9d61361 | 2016-05-16 17:22:25 +0000 | [diff] [blame] | 30 | // 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 |
| 31 | // 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 |
| 32 | // 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 |
| 33 | // 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 |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 34 | |
Paul Robinson | 9d61361 | 2016-05-16 17:22:25 +0000 | [diff] [blame] | 35 | // 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 |
| 36 | // 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 |
| 37 | // 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 |
| 38 | // 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 |
| 39 | // 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 |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 40 | |
Paul Robinson | 9d61361 | 2016-05-16 17:22:25 +0000 | [diff] [blame] | 41 | // RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -nostdlib -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-SYS-HEADERS -check-prefix=NO-WARN %s |
| 42 | // RUN: env SCE_ORBIS_SDK_DIR=.. %clang -Winvalid-or-nonexistent-directory -### -nodefaultlibs -target x86_64-scei-ps4 %s 2>&1 | FileCheck -check-prefix=WARN-SYS-HEADERS -check-prefix=NO-WARN %s |
Filipe Cabecinhas | c888e19 | 2015-10-14 12:25:43 +0000 | [diff] [blame] | 43 | |
| 44 | // NO-WARN-NOT: {{warning:|error:}} |
| 45 | // WARN-SYS-HEADERS: warning: unable to find PS4 system headers directory |
| 46 | // WARN-ISYSROOT: warning: no such sysroot directory: 'foo' |
| 47 | // WARN-SYS-LIBS: warning: unable to find PS4 system libraries directory |
| 48 | // NO-WARN-NOT: {{warning:|error:}} |