104a1a348SFangrui Song // RUN: not %clang -### -c --target=x86_64 -Wa,--crel %s 2>&1 | FileCheck %s --check-prefix=NOEXP 204a1a348SFangrui Song 304a1a348SFangrui Song // NOEXP: error: -Wa,--allow-experimental-crel must be specified to use -Wa,--crel. CREL is experimental and uses a non-standard section type code 404a1a348SFangrui Song 504a1a348SFangrui Song // RUN: %clang -### -c --target=x86_64 -Wa,--crel,--allow-experimental-crel %s -Werror 2>&1 | FileCheck %s 604a1a348SFangrui Song // RUN: %clang -### -c --target=x86_64 -Wa,--crel,--no-crel,--allow-experimental-crel %s -Werror 2>&1 | FileCheck %s --check-prefix=NO 704a1a348SFangrui Song // RUN: %clang -### -c --target=x86_64 -Wa,--allow-experimental-crel %s -Werror 2>&1 | FileCheck %s --check-prefix=NO 804a1a348SFangrui Song // RUN: not %clang -### -c --target=arm64-apple-darwin -Wa,--crel,--allow-experimental-crel %s 2>&1 | FileCheck %s --check-prefix=ERR 904a1a348SFangrui Song // RUN: not %clang -### -c --target=mips64 -Wa,--crel,--allow-experimental-crel %s 2>&1 | FileCheck %s --check-prefix=ERR 1004a1a348SFangrui Song 1104a1a348SFangrui Song // RUN: %clang -### -c --target=aarch64 -Werror -Wa,--crel,--allow-experimental-crel -x assembler %s -Werror 2>&1 | FileCheck %s --check-prefix=ASM 1204a1a348SFangrui Song // RUN: not %clang -### -c --target=mips64 -Wa,--crel,--allow-experimental-crel -x assembler %s 2>&1 | FileCheck %s --check-prefix=ERR 1304a1a348SFangrui Song 1404a1a348SFangrui Song // CHECK: "-cc1" {{.*}}"--crel" 1504a1a348SFangrui Song // NO: "-cc1" 1604a1a348SFangrui Song // NO-NOT: "--crel" 1704a1a348SFangrui Song // ASM: "-cc1as" {{.*}}"--crel" 1804a1a348SFangrui Song // ERR: error: unsupported option '-Wa,--crel' for target '{{.*}}' 1904a1a348SFangrui Song 2004a1a348SFangrui Song /// The --allow-experimental-crel error check is exempted for -fno-integrated-as. 2104a1a348SFangrui Song // RUN: %clang -### -c --target=aarch64 -fno-integrated-as -Wa,--crel %s -Werror 2>&1 | FileCheck %s --check-prefix=GAS 2204a1a348SFangrui Song 2304a1a348SFangrui Song // GAS: "--crel" 2404a1a348SFangrui Song 2504a1a348SFangrui Song /// The --allow-experimental-crel error check doesn't apply to LTO. 2604a1a348SFangrui Song // RUN: %clang -### --target=x86_64-linux -Werror -flto -Wa,--crel %s 2>&1 | FileCheck %s --check-prefix=LTO 27*812e049aSFangrui Song // RUN: %clang -### --target=x86_64-linux -Werror -flto -Wa,--crel -Wa,--no-crel %s 2>&1 | FileCheck %s --check-prefix=LTO-NO 2804a1a348SFangrui Song 2904a1a348SFangrui Song // LTO: "-plugin-opt=-crel" 30*812e049aSFangrui Song // LTO-NO-NOT: "-plugin-opt=-crel" 3104a1a348SFangrui Song 3204a1a348SFangrui Song // RUN: touch %t.o 3304a1a348SFangrui Song // RUN: not %clang -### --target=mips64-linux-gnu -flto -Wa,--crel %t.o 2>&1 | FileCheck %s --check-prefix=ERR 34