1 // Android, Cygwin and OpenBSD use emutls by default. 2 // Clang should pass -femulated-tls to cc1 if they are used, 3 // and cc1 should set up EmulatedTLS to LLVM CodeGen. 4 // 5 // RUN: %clang -### --target=arm-linux-androideabi %s 2>&1 \ 6 // RUN: | FileCheck -check-prefix=EMU %s 7 // RUN: %clang -### --target=arm-linux-gnu %s 2>&1 \ 8 // RUN: | FileCheck -check-prefix=NOEMU %s 9 // RUN: %clang -### --target=i686-pc-cygwin %s 2>&1 \ 10 // RUN: | FileCheck -check-prefix=EMU %s 11 // RUN: %clang -### --target=i686-pc-openbsd %s 2>&1 \ 12 // RUN: | FileCheck -check-prefix=EMU %s 13 14 // RUN: %clang -### -target arm-linux-androideabi -fno-emulated-tls -femulated-tls %s 2>&1 \ 15 // RUN: | FileCheck -check-prefix=EMU %s 16 // RUN: %clang -### -target arm-linux-gnu %s -fno-emulated-tls -femulated-tls 2>&1 \ 17 // RUN: | FileCheck -check-prefix=EMU %s 18 // RUN: %clang -### -target i686-pc-cygwin %s -fno-emulated-tls -femulated-tls 2>&1 \ 19 // RUN: | FileCheck -check-prefix=EMU %s 20 // RUN: %clang -### -target i686-pc-openbsd %s -fno-emulated-tls -femulated-tls 2>&1 \ 21 // RUN: | FileCheck -check-prefix=EMU %s 22 23 // RUN: %clang -### -target arm-linux-androideabi -femulated-tls -fno-emulated-tls %s 2>&1 \ 24 // RUN: | FileCheck -check-prefix=NOEMU %s 25 // RUN: %clang -### -target arm-linux-gnu %s -femulated-tls -fno-emulated-tls 2>&1 \ 26 // RUN: | FileCheck -check-prefix=NOEMU %s 27 // RUN: %clang -### -target i686-pc-cygwin %s -femulated-tls -fno-emulated-tls 2>&1 \ 28 // RUN: | FileCheck -check-prefix=NOEMU %s 29 // RUN: %clang -### -target i686-pc-openbsd %s -femulated-tls -fno-emulated-tls 2>&1 \ 30 // RUN: | FileCheck -check-prefix=NOEMU %s 31 32 // Test that when lto is used any -emualted-tls flags are passed to the linker 33 // LINUX and Android have different defaults for EmulatedTLS 34 // RUN: %clang -### -flto --target=riscv64-linux -fno-emulated-tls %s 2>&1 \ 35 // RUN: | FileCheck %s --check-prefix=LTO_NOEMUTLS 36 // RUN: %clang -### -flto --target=riscv64-linux-android10000 -femulated-tls %s 2>&1 \ 37 // RUN: | FileCheck %s --check-prefix=LTO_EMUTLS 38 // RUN: %clang -### -flto --target=riscv64-linux -femulated-tls %s 2>&1 \ 39 // RUN: | FileCheck %s --check-prefix=LTO_EMUTLS 40 // RUN: %clang -### -flto --target=riscv64-linux-android10000 -fno-emulated-tls %s 2>&1 \ 41 // RUN: | FileCheck %s --check-prefix=LTO_NOEMUTLS 42 // RUN: %clang -### -flto --target=amd64-unknown-openbsd %s 2>&1 \ 43 // RUN: | FileCheck %s --check-prefix=LTO_EMUTLS 44 45 // Default without -f[no-]emulated-tls, will be decided by the target triple. 46 // DEFAULT-NOT: "-cc1" {{.*}}"-femulated-tls" 47 48 // EMU: "-cc1" 49 // EMU-SAME: "-femulated-tls" 50 51 // NOEMU: "-cc1" 52 // NOEMU-NOT: "-femulated-tls" 53 54 // LTO related checks 55 // LTO_NOEMUTLS-NOT: "-plugin-opt=-emulated-tls" 56 57 // LTO_EMUTLS: "-plugin-opt=-emulated-tls" 58