Clang Project

clang_source_code/test/Driver/emulated-tls.cpp
1// Android, Cygwin and OpenBSD use emutls by default.
2// Clang should pass -femulated-tls or -fno-emulated-tls to cc1 if they are used,
3// and cc1 should set up EmulatedTLS and ExplicitEmulatedTLS to LLVM CodeGen.
4//
5// RUN: %clang -### -target arm-linux-androideabi %s 2>&1 \
6// RUN: | FileCheck -check-prefix=DEFAULT %s
7// RUN: %clang -### -target arm-linux-gnu %s 2>&1 \
8// RUN: | FileCheck -check-prefix=DEFAULT %s
9// RUN: %clang -### -target i686-pc-cygwin %s 2>&1 \
10// RUN: | FileCheck -check-prefix=DEFAULT %s
11// RUN: %clang -### -target i686-pc-openbsd %s 2>&1 \
12// RUN: | FileCheck -check-prefix=DEFAULT %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
33// Default without -f[no-]emulated-tls, will be decided by the target triple.
34// DEFAULT-NOT: "-cc1" {{.*}}"-femulated-tls"
35// DEFAULT-NOT: "-cc1" {{.*}}"-fno-emulated-tls"
36
37// Explicit and last -f[no-]emulated-tls flag will be passed to cc1.
38// EMU: "-cc1" {{.*}}"-femulated-tls"
39// EMU-NOT: "-cc1" {{.*}}"-fno-emulated-tls"
40
41// NOEMU: "-cc1" {{.*}}"-fno-emulated-tls"
42// NOEMU-NOT: "-cc1" {{.*}}"-femulated-tls"
43