xref: /llvm-project/clang/test/Driver/arm-thread-pointer.c (revision f39c399d9d15efe8309d8aa3d0ecf62205e6c474)
110e42281SSimon Tatham // Test of the AArch32 values of -mtp=, checking that each one maps to
210e42281SSimon Tatham // the right target features.
310e42281SSimon Tatham 
410e42281SSimon Tatham // RUN: %clang --target=armv7-linux -mtp=cp15 -### -S %s 2>&1 | \
510e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARMv7_THREAD_POINTER-HARD %s
610e42281SSimon Tatham // ARMv7_THREAD_POINTER-HARD: "-target-feature" "+read-tp-tpidruro"
710e42281SSimon Tatham 
810e42281SSimon Tatham // RUN: %clang --target=armv7-linux -mtp=tpidruro -### -S %s 2>&1 | \
910e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARMv7_THREAD_POINTER-HARD %s
1010e42281SSimon Tatham // RUN: %clang --target=armv7-linux -mtp=tpidrurw -### -S %s 2>&1 | \
1110e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARMv7_THREAD_POINTER-TPIDRURW %s
1210e42281SSimon Tatham // ARMv7_THREAD_POINTER-TPIDRURW: "-target-feature" "+read-tp-tpidrurw"
1310e42281SSimon Tatham // RUN: %clang --target=armv7-linux -mtp=tpidrprw -### -S %s 2>&1 | \
1410e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARMv7_THREAD_POINTER-TPIDRPRW %s
1510e42281SSimon Tatham // ARMv7_THREAD_POINTER-TPIDRPRW: "-target-feature" "+read-tp-tpidrprw"
1610e42281SSimon Tatham 
1710e42281SSimon Tatham // RUN: %clang --target=armv6t2-linux -mtp=cp15 -### -S %s 2>&1 | \
1810e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARM_THREAD_POINTER-HARD %s
1910e42281SSimon Tatham // RUN: %clang --target=thumbv6t2-linux -mtp=cp15 -### -S %s 2>&1 | \
2010e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARM_THREAD_POINTER-HARD %s
2110e42281SSimon Tatham // RUN: %clang --target=armv6k-linux -mtp=cp15 -### -S %s 2>&1 | \
2210e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARM_THREAD_POINTER-HARD %s
2310e42281SSimon Tatham // RUN: %clang --target=armv6-linux -mtp=cp15 -### -S %s 2>&1 | \
2410e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARM_THREAD_POINTER-HARD %s
2510e42281SSimon Tatham // RUN: %clang --target=armv5t-linux -mtp=cp15 -### -S %s 2>&1 | \
2610e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARM_THREAD_POINTER-HARD %s
2710e42281SSimon Tatham // ARM_THREAD_POINTER-HARD: "-target-feature" "+read-tp-tpidruro"
2810e42281SSimon Tatham 
2910e42281SSimon Tatham // RUN: %clang --target=armv5t-linux -mtp=cp15 -x assembler -### %s 2>&1 | \
3010e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARMv5_THREAD_POINTER_ASSEMBLER %s
3110e42281SSimon Tatham // ARMv5_THREAD_POINTER_ASSEMBLER-NOT: hardware TLS register is not supported for the armv5 sub-architecture
3210e42281SSimon Tatham 
33*f39c399dSFangrui Song // RUN: not %clang --target=armv6-linux -mthumb -mtp=cp15 -### -S %s 2>&1 | \
3410e42281SSimon Tatham // RUN: FileCheck -check-prefix=THUMBv6_THREAD_POINTER_UNSUPP %s
35*f39c399dSFangrui Song // RUN: not %clang --target=thumbv6-linux -mthumb -mtp=cp15 -### -S %s 2>&1 | \
3610e42281SSimon Tatham // RUN: FileCheck -check-prefix=THUMBv6_THREAD_POINTER_UNSUPP %s
3710e42281SSimon Tatham // THUMBv6_THREAD_POINTER_UNSUPP: hardware TLS register is not supported for the thumbv6 sub-architecture
3810e42281SSimon Tatham 
3910e42281SSimon Tatham // RUN: %clang --target=armv7-linux -mtp=soft -### -S %s 2>&1 | \
4010e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARMv7_THREAD_POINTER_SOFT %s
4110e42281SSimon Tatham // ARMv7_THREAD_POINTER_SOFT-NOT: "-target-feature" "+read-tp-tpidruro"
4210e42281SSimon Tatham 
4310e42281SSimon Tatham // RUN: %clang --target=armv7-linux -### -S %s 2>&1 | \
4410e42281SSimon Tatham // RUN: FileCheck -check-prefix=ARMv7_THREAD_POINTER_NON %s
4510e42281SSimon Tatham // ARMv7_THREAD_POINTER_NON-NOT: "-target-feature" "+read-tp-tpidruro"
46