diff options
| author | Bradley Smith <bradley.smith@arm.com> | 2016-03-03 13:52:22 +0000 | 
|---|---|---|
| committer | Bradley Smith <bradley.smith@arm.com> | 2016-03-03 13:52:22 +0000 | 
| commit | f4affc13c52f03683568450a6387a38519a17bdb (patch) | |
| tree | 91764e59069356494294f44be9f848a937db0ef0 /clang/test | |
| parent | 65c02ec83785e6e4ddb656d7bc33d7242ef0737d (diff) | |
| download | bcm5719-llvm-f4affc13c52f03683568450a6387a38519a17bdb.tar.gz bcm5719-llvm-f4affc13c52f03683568450a6387a38519a17bdb.zip  | |
[ARM] Add Clang targeting for ARMv8-M Baseline/Mainline
llvm-svn: 262619
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Driver/arm-alignment.c | 8 | ||||
| -rw-r--r-- | clang/test/Driver/arm-cortex-cpus.c | 18 | ||||
| -rw-r--r-- | clang/test/Driver/arm-features.c | 6 | ||||
| -rw-r--r-- | clang/test/Preprocessor/arm-target-features.c | 36 | 
4 files changed, 65 insertions, 3 deletions
diff --git a/clang/test/Driver/arm-alignment.c b/clang/test/Driver/arm-alignment.c index 3e216520395..e0b4946d0a4 100644 --- a/clang/test/Driver/arm-alignment.c +++ b/clang/test/Driver/arm-alignment.c @@ -83,11 +83,13 @@  // CHECK-ALIGNED-ARM: "-target-feature" "+strict-align"  // CHECK-ALIGNED-AARCH64: "-target-feature" "+strict-align" -// Make sure that v6M cores always trigger the unsupported aligned accesses error -// for all supported architecture triples. +// Make sure that v6M cores and v8M Baseline always trigger the unsupported +// aligned accesses error for all supported architecture triples.  // RUN: not %clang -c -target thumbv6m-none-gnueabi -mcpu=cortex-m0 -munaligned-access %s 2>&1 | \  // RUN:   FileCheck --check-prefix CHECK-UNALIGN-NOT-SUPPORTED %s  // RUN: not %clang -c -target thumb-none-gnueabi -mcpu=cortex-m0 -munaligned-access %s 2>&1 | \  // RUN:   FileCheck --check-prefix CHECK-UNALIGN-NOT-SUPPORTED %s +// RUN: not %clang -c -target thumbv8m.base-none-gnueabi -munaligned-access %s 2>&1 | \ +// RUN:   FileCheck --check-prefix CHECK-UNALIGN-NOT-SUPPORTED %s -// CHECK-UNALIGN-NOT-SUPPORTED: error: the v6m sub-architecture does not support unaligned accesses +// CHECK-UNALIGN-NOT-SUPPORTED: error: the {{.*}} sub-architecture does not support unaligned accesses diff --git a/clang/test/Driver/arm-cortex-cpus.c b/clang/test/Driver/arm-cortex-cpus.c index fdacfb8fbe7..a882c8acadc 100644 --- a/clang/test/Driver/arm-cortex-cpus.c +++ b/clang/test/Driver/arm-cortex-cpus.c @@ -273,6 +273,24 @@  // CHECK-CORTEX-A53-FP16: "-cc1" {{.*}}"-target-cpu" "cortex-a53" {{.*}}"-target-feature" "+fullfp16"  // CHECK-CORTEX-A53-NOFP16: "-cc1" {{.*}}"-target-cpu" "cortex-a53" {{.*}}"-target-feature" "-fullfp16" +// RUN: %clang -target armv8m.base %s -### -c 2>&1 | FileCheck %s --check-prefix=V8M_BASELINE +// RUN: %clang -target arm -march=armv8-m.base %s -### -c 2>&1 | FileCheck %s --check-prefix=V8M_BASELINE +// RUN: %clang -target arm -march=armv8m.base %s -### -c 2>&1 | FileCheck %s --check-prefix=V8M_BASELINE +// RUN: %clang -target armv8m.base -mbig-endian %s -### -c 2>&1 | FileCheck %s --check-prefix=EBV8M_BASELINE +// RUN: %clang -target arm -march=armv8-m.base -mbig-endian %s -### -c 2>&1 | FileCheck %s --check-prefix=EBV8M_BASELINE +// RUN: %clang -target arm -march=armv8m.base -mbig-endian %s -### -c 2>&1 | FileCheck %s --check-prefix=EBV8M_BASELINE +// V8M_BASELINE: "-cc1"{{.*}} "-triple" "thumbv8m.base-{{.*}} "-target-cpu" "generic" +// EBV8M_BASELINE: "-cc1"{{.*}} "-triple" "thumbebv8m.base-{{.*}} "-target-cpu" "generic" + +// RUN: %clang -target armv8m.main %s -### -c 2>&1 | FileCheck %s --check-prefix=V8M_MAINLINE +// RUN: %clang -target arm -march=armv8-m.main %s -### -c 2>&1 | FileCheck %s --check-prefix=V8M_MAINLINE +// RUN: %clang -target arm -march=armv8m.main %s -### -c 2>&1 | FileCheck %s --check-prefix=V8M_MAINLINE +// RUN: %clang -target armv8m.main -mbig-endian %s -### -c 2>&1 | FileCheck %s --check-prefix=EBV8M_MAINLINE +// RUN: %clang -target arm -march=armv8-m.main -mbig-endian %s -### -c 2>&1 | FileCheck %s --check-prefix=EBV8M_MAINLINE +// RUN: %clang -target arm -march=armv8m.main -mbig-endian %s -### -c 2>&1 | FileCheck %s --check-prefix=EBV8M_MAINLINE +// V8M_MAINLINE: "-cc1"{{.*}} "-triple" "thumbv8m.main-{{.*}} "-target-cpu" "generic" +// EBV8M_MAINLINE: "-cc1"{{.*}} "-triple" "thumbebv8m.main-{{.*}} "-target-cpu" "generic" +  // ================== Check that a bogus architecture gives an error  // RUN: %clang -target arm -march=armbogusv6 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-BOGUS %s  // CHECK-BOGUS: error: {{.*}} does not support '-march=armbogusv6'  diff --git a/clang/test/Driver/arm-features.c b/clang/test/Driver/arm-features.c index eb197da935a..74cedf3bd83 100644 --- a/clang/test/Driver/arm-features.c +++ b/clang/test/Driver/arm-features.c @@ -4,6 +4,9 @@  // RUN: %clang -target arm-none-none-eabi -mcpu=generic+crypto -march=armv8a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO %s  // RUN: %clang -target arm-none-none-eabi -mcpu=generic -march=armv8a+crypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CRYPTO %s  // CHECK-CRYPTO: "-cc1"{{.*}} "-triple" "armv8-{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "+crypto" +// RUN: %clang -target arm-none-none-eabi -mcpu=generic+dsp -march=armv8m.main -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-DSP %s +// RUN: %clang -target arm-none-none-eabi -mcpu=generic -march=armv8m.main+dsp -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-DSP %s +// CHECK-DSP: "-cc1"{{.*}} "-triple" "thumbv8m.main-{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "+dsp"  // RUN: %clang -target arm-none-none-eabi -mcpu=generic+nocrc -march=armv8a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRC %s  // RUN: %clang -target arm-none-none-eabi -mcpu=generic -march=armv8a+nocrc -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRC %s @@ -11,3 +14,6 @@  // RUN: %clang -target arm-none-none-eabi -mcpu=generic+nocrypto -march=armv8a -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO %s  // RUN: %clang -target arm-none-none-eabi -mcpu=generic -march=armv8a+nocrypto -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NOCRYPTO %s  // CHECK-NOCRYPTO: "-cc1"{{.*}} "-triple" "armv8-{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "-crypto" +// RUN: %clang -target arm-none-none-eabi -mcpu=generic+nodsp -march=armv8m.main -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NODSP %s +// RUN: %clang -target arm-none-none-eabi -mcpu=generic -march=armv8m.main+nodsp -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NODSP %s +// CHECK-NODSP: "-cc1"{{.*}} "-triple" "thumbv8m.main-{{.*}} "-target-cpu" "generic"{{.*}} "-target-feature" "-dsp" diff --git a/clang/test/Preprocessor/arm-target-features.c b/clang/test/Preprocessor/arm-target-features.c index 21fedff9bf2..54eb96f06a7 100644 --- a/clang/test/Preprocessor/arm-target-features.c +++ b/clang/test/Preprocessor/arm-target-features.c @@ -95,6 +95,42 @@  // THUMBV8A-EABI:#define __ARM_ARCH_EXT_IDIV__ 1  // THUMBV8A-EABI: #define __ARM_FP 0xE +// RUN: %clang -target armv8m.base-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=V8M_BASELINE %s +// V8M_BASELINE: __ARM_ARCH 8 +// V8M_BASELINE: __ARM_ARCH_8M_BASE__ 1 +// V8M_BASELINE: __ARM_ARCH_EXT_IDIV__ 1 +// V8M_BASELINE-NOT: __ARM_ARCH_ISA_ARM +// V8M_BASELINE: __ARM_ARCH_ISA_THUMB 1 +// V8M_BASELINE: __ARM_ARCH_PROFILE 'M' +// V8M_BASELINE-NOT: __ARM_FEATURE_CRC32 +// V8M_BASELINE-NOT: __ARM_FEATURE_DSP +// V8M_BASELINE-NOT: __ARM_FP 0x{{.*}} +// V8M_BASELINE-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 + +// RUN: %clang -target armv8m.main-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=V8M_MAINLINE %s +// V8M_MAINLINE: __ARM_ARCH 8 +// V8M_MAINLINE: __ARM_ARCH_8M_MAIN__ 1 +// V8M_MAINLINE: __ARM_ARCH_EXT_IDIV__ 1 +// V8M_MAINLINE-NOT: __ARM_ARCH_ISA_ARM +// V8M_MAINLINE: __ARM_ARCH_ISA_THUMB 2 +// V8M_MAINLINE: __ARM_ARCH_PROFILE 'M' +// V8M_MAINLINE-NOT: __ARM_FEATURE_CRC32 +// V8M_MAINLINE-NOT: __ARM_FEATURE_DSP +// V8M_MAINLINE: __ARM_FP 0xE +// V8M_MAINLINE: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 + +// RUN: %clang -target arm-none-linux-gnu -march=armv8-m.main+dsp -x c -E -dM %s -o - | FileCheck --check-prefix=V8M_MAINLINE_DSP %s +// V8M_MAINLINE_DSP: __ARM_ARCH 8 +// V8M_MAINLINE_DSP: __ARM_ARCH_8M_MAIN__ 1 +// V8M_MAINLINE_DSP: __ARM_ARCH_EXT_IDIV__ 1 +// V8M_MAINLINE_DSP-NOT: __ARM_ARCH_ISA_ARM +// V8M_MAINLINE_DSP: __ARM_ARCH_ISA_THUMB 2 +// V8M_MAINLINE_DSP: __ARM_ARCH_PROFILE 'M' +// V8M_MAINLINE_DSP-NOT: __ARM_FEATURE_CRC32 +// V8M_MAINLINE_DSP: __ARM_FEATURE_DSP 1 +// V8M_MAINLINE_DSP: __ARM_FP 0xE +// V8M_MAINLINE_DSP: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 +  // RUN: %clang -target arm-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-DEFS %s  // CHECK-DEFS:#define __ARM_PCS 1  // CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4  | 

