brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · ba4c0e1 Raw
30 lines · c
1// REQUIRES: x86-registered-target2 3// System directory and sysroot option causes warning.4// RUN: %clang -Wpoison-system-directories -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr5// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s6// RUN: %clang -Wpoison-system-directories -target x86_64 -cxx-isystem/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr7// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s8// RUN: %clang -Wpoison-system-directories -target x86_64 -iquote/usr/local/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr9// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s10// RUN: %clang -Wpoison-system-directories -target x86_64 -isystem/usr/local/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.1.stderr11// RUN: FileCheck -check-prefix=WARN < %t.1.stderr %s12 13// Missing target but included sysroot still causes the warning.14// RUN: %clang -Wpoison-system-directories -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.2.stderr15// RUN: FileCheck -check-prefix=WARN < %t.2.stderr %s16 17// With -Werror the warning causes the failure.18// RUN: not %clang -Werror=poison-system-directories -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s 2> %t.3.stderr19// RUN: FileCheck -check-prefix=ERROR < %t.3.stderr %s20 21// Cros target without sysroot causes no warning.22// RUN: %clang -Wpoison-system-directories -Werror -target x86_64 -I/usr/include -c -o - %s23 24// By default the warning is off.25// RUN: %clang -Werror -target x86_64 -I/usr/include --sysroot %S/Inputs/sysroot_x86_64_cross_linux_tree -c -o - %s26 27// WARN: warning: include location {{[^ ]+}} is unsafe for cross-compilation [-Wpoison-system-directories]28 29// ERROR: error: include location {{[^ ]+}} is unsafe for cross-compilation [-Werror,-Wpoison-system-directories]30