CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
91 lines
5.0 KiB
C
91 lines
5.0 KiB
C
// This file tests the -mtp=<mode> functionality in Clang’s ARM driver.
|
||
// It verifies:
|
||
//
|
||
// 1. ARMv7 targets: explicit hardware modes, explicit soft mode, and auto mode.
|
||
// 2. M Profile variants: explicit hardware mode should fail and auto mode defaults to soft.
|
||
// 3. ARMv6 variants: explicit hardware modes on ARMv6K/KZ work, but auto mode falls back to soft when Thumb2 is missing.
|
||
// 4. ARMv5 variants: explicit hardware mode is rejected and auto mode defaults to soft.
|
||
// 5. Miscellaneous error cases (e.g. empty -mtp value).
|
||
//
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
//===----------------------------------------------------------------------===//
|
||
// 1. ARMv7 Targets
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
// Test explicit hardware mode using "tpidrprw" on an ARMv7 target.
|
||
// RUN: %clang --target=armv7-linux -mtp=tpidrprw -### -S %s 2>&1 | FileCheck -check-prefix=ARMv7_TPIDRPRW %s
|
||
// ARMv7_TPIDRPRW: "-target-feature" "+read-tp-tpidrprw"
|
||
|
||
// Test explicit hardware mode using "tpidrurw" on an ARMv7 target.
|
||
// RUN: %clang --target=armv7-linux -mtp=tpidrurw -### -S %s 2>&1 | FileCheck -check-prefix=ARMv7_TPIDRURW %s
|
||
// ARMv7_TPIDRURW: "-target-feature" "+read-tp-tpidrurw"
|
||
|
||
// Test explicit hardware mode using "tpidruro" on an ARMv7 target.
|
||
// RUN: %clang --target=armv7-linux -mtp=tpidruro -### -S %s 2>&1 | FileCheck -check-prefix=ARMv7_TPIDRURO %s
|
||
// ARMv7_TPIDRURO: "-target-feature" "+read-tp-tpidruro"
|
||
|
||
// Test explicit "soft" mode on an ARMv7 target (forces software mode).
|
||
// RUN: %clang --target=armv7-linux -mtp=soft -### -S %s 2>&1 | FileCheck -check-prefix=ARM_Soft %s
|
||
// ARM_Soft-NOT: "-target-feature" "+read-tp-"
|
||
|
||
// Test auto mode on an ARMv7 target (hardware support and Thumb2 yield HW mode).
|
||
// RUN: %clang --target=armv7-linux -mtp=auto -### -S %s 2>&1 | FileCheck -check-prefix=ARMv7_Auto %s
|
||
// Default mode is implicitly -mtp=auto
|
||
// RUN: %clang --target=armv7-linux -### -S %s 2>&1 | FileCheck -check-prefix=ARMv7_Auto %s
|
||
// ARMv7_Auto: "-target-feature" "+read-tp-tpidruro"
|
||
|
||
//===----------------------------------------------------------------------===//
|
||
// 2. M Profile Variants (e.g. thumbv6t2)
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
// Test explicit hardware mode on a M Profile target: thumbv6t2 does not support CP15.
|
||
// RUN: not %clang --target=thumbv6t2-linux -mtp=cp15 -### -S %s 2>&1 | FileCheck -check-prefix=Thumbv6t2_Error %s
|
||
// Thumbv6t2_Error: error: hardware TLS register is not supported for the armv6t2 sub-architecture
|
||
|
||
// Test auto mode on a M Profile target: should default to soft mode.
|
||
// RUN: %clang --target=thumbv6t2-linux -mtp=auto -### -S %s 2>&1 | FileCheck -check-prefix=Thumbv6t2_Auto %s
|
||
// Thumbv6t2_Auto-NOT: "-target-feature" "+read-tp-"
|
||
|
||
|
||
//===----------------------------------------------------------------------===//
|
||
// 3. ARMv6 Variants
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
// Test explicit hardware mode using "cp15" on an ARMv6K and ARMv6KZ targets.
|
||
// RUN: %clang --target=armv6k-linux -mtp=cp15 -### -S %s 2>&1 | FileCheck -check-prefix=ARMv6k_Cp15 %s
|
||
// RUN: %clang --target=armv6kz-linux -mtp=cp15 -### -S %s 2>&1 | FileCheck -check-prefix=ARMv6k_Cp15 %s
|
||
// ARMv6k_Cp15: "-target-feature" "+read-tp-tpidruro"
|
||
|
||
|
||
// Test auto mode on ARMv6K and ARMv6KZ targets: defaults to soft mode due to missing Thumb2 encoding.
|
||
// RUN: %clang --target=armv6k-linux -mtp=auto -### -S %s 2>&1 | FileCheck -check-prefix=ARMv6k_Auto %s
|
||
// RUN: %clang --target=armv6kz-linux -mtp=auto -### -S %s 2>&1 | FileCheck -check-prefix=ARMv6k_Auto %s
|
||
// ARMv6k_Auto-NOT: "-target-feature" "+read-tp-"
|
||
|
||
|
||
//===----------------------------------------------------------------------===//
|
||
// 4. ARMv5 Variants
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
// Test explicit hardware mode on an ARMv5T target: hardware TP is not supported.
|
||
// RUN: not %clang --target=armv5t-linux -mtp=cp15 -### -S %s 2>&1 | FileCheck -check-prefix=ARMv5t_Error %s
|
||
// ARMv5t_Error: error: hardware TLS register is not supported for the armv5 sub-architecture
|
||
|
||
// Test auto mode on an ARMv5T target: should default to soft mode.
|
||
// RUN: %clang --target=armv5t-linux -mtp=auto -### -S %s 2>&1 | FileCheck -check-prefix=ARMv5t_Auto %s
|
||
// ARMv5t_Auto-NOT: "-target-feature" "+read-tp-"
|
||
|
||
//===----------------------------------------------------------------------===//
|
||
// 5. Miscellaneous Tests
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
// Test empty -mtp value on an ARMv7 target: should produce a missing argument error.
|
||
// RUN: not %clang --target=armv7-linux -mtp= -### -S %s 2>&1 | FileCheck -check-prefix=Empty_MTP %s
|
||
// Empty_MTP: error: {{.*}}missing
|
||
|
||
// Test explicit hardware mode in assembler mode on an unsupporting target does not fail with error
|
||
// RUN: %clang --target=thumbv6t2-linux -mtp=cp15 -x assembler -### %s 2>&1 | FileCheck -check-prefix=Thumbv6t2_Asm %s
|
||
// Thumbv6t2_Asm-NOT: "-target-feature" "+read-tp-"
|
||
|