1*1adca7afSSebastian Kreutzer // Check supported targets 2e738a5d8SSebastian Kreutzer // RUN: %clang -### --target=x86_64-unknown-linux-gnu -fPIC -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s 3*1adca7afSSebastian Kreutzer // RUN: %clang -### --target=aarch64-unknown-linux-gnu -fPIC -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s 4*1adca7afSSebastian Kreutzer 5*1adca7afSSebastian Kreutzer // Check unsupported targets 6*1adca7afSSebastian Kreutzer // RUN: not %clang -### --target=arm-unknown-linux-gnu -fPIC -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-TARGET 7*1adca7afSSebastian Kreutzer // RUN: not %clang -### --target=mips-unknown-linux-gnu -fPIC -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-TARGET 8*1adca7afSSebastian Kreutzer // RUN: not %clang -### --target=loongarch64-unknown-linux-gnu -fPIC -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-TARGET 9*1adca7afSSebastian Kreutzer // RUN: not %clang -### --target=hexagon-unknown-linux-gnu -fPIC -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-TARGET 10*1adca7afSSebastian Kreutzer // RUN: not %clang -### --target=powerpc64le-unknown-linux-gnu -fPIC -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-TARGET 11*1adca7afSSebastian Kreutzer 12*1adca7afSSebastian Kreutzer // Check PIC requirement 13e738a5d8SSebastian Kreutzer // RUN: %clang -### --target=x86_64-unknown-linux-gnu -fpic -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s 14e738a5d8SSebastian Kreutzer // RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fno-PIC -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-PIC 15e738a5d8SSebastian Kreutzer // RUN: not %clang -### --target=x86_64-unknown-linux-gnu -fno-pic -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-PIC 16e738a5d8SSebastian Kreutzer // On 64 bit darwin, PIC is always enabled 17e738a5d8SSebastian Kreutzer // RUN: %clang -### --target=x86_64-apple-darwin -fxray-instrument -fxray-shared -c %s -o /dev/null 2>&1 | FileCheck %s 18e738a5d8SSebastian Kreutzer 19e738a5d8SSebastian Kreutzer // CHECK: "-cc1" {{.*}}"-fxray-instrument" {{.*}}"-fxray-shared" 20e738a5d8SSebastian Kreutzer // ERR-TARGET: error: unsupported option '-fxray-shared' for target 21e738a5d8SSebastian Kreutzer // ERR-PIC: error: option '-fxray-shared' cannot be specified without '-fPIC' 22e738a5d8SSebastian Kreutzer 23