Skip to content

Commit 5fedb7c

Browse files
authored
[Clang][ARM] Fix tests using thumb instead arm arch on cc1 (#166416)
Currently, the ARM backend incorrectly parses every `arm` prefixed arch to be non-thumb, but `armv6m` is THUMB and doesnt have ARM ops causing the test to fail when compiling to assembly and not LLVM IR: `error: Function 'foo' uses ARM instructions, but the target does not support ARM mode execution.` This only happens when invoking cc1 directly and not the Clang driver. As a quick triage, this patch changes the tests to use `thumb`. Uncovered by #151404
1 parent 438a18c commit 5fedb7c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

clang/test/AST/ast-dump-arm-attr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %clang_cc1 -triple arm-apple-darwin -ast-dump -ast-dump-filter Test %s \
33
// RUN: | FileCheck --strict-whitespace %s
44
//
5-
// RUN: %clang_cc1 -triple armv8m.base-none-eabi -mcmse -ast-dump -ast-dump-filter Test %s \
5+
// RUN: %clang_cc1 -triple thumbv8m.base-none-eabi -mcmse -ast-dump -ast-dump-filter Test %s \
66
// RUN: | FileCheck --strict-whitespace %s --check-prefix=CHECK-CMSE
77
//
88
// Tests with serialization:
@@ -11,8 +11,8 @@
1111
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
1212
// RUN: | FileCheck --strict-whitespace %s
1313
//
14-
// RUN: %clang_cc1 -triple armv8m.base-none-eabi -mcmse -emit-pch -o %t %s
15-
// RUN: %clang_cc1 -x c -triple armv8m.base-none-eabi -mcmse -include-pch %t -ast-dump-all -ast-dump-filter Test /dev/null \
14+
// RUN: %clang_cc1 -triple thumbv8m.base-none-eabi -mcmse -emit-pch -o %t %s
15+
// RUN: %clang_cc1 -x c -triple thumbv8m.base-none-eabi -mcmse -include-pch %t -ast-dump-all -ast-dump-filter Test /dev/null \
1616
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
1717
// RUN: | FileCheck --strict-whitespace %s
1818

clang/test/CodeGen/arm-acle-coproc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
// RUN: %clang_cc1 -triple armv5te %s -E -dD -o - | FileCheck --check-prefix=CHECK-V5-TE %s
55
// RUN: %clang_cc1 -triple armv5tej %s -E -dD -o - | FileCheck --check-prefix=CHECK-V5-TE %s
66
// RUN: %clang_cc1 -triple armv6 %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6 %s
7-
// RUN: %clang_cc1 -triple armv6m %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6M %s
7+
// RUN: %clang_cc1 -triple thumbv6m %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6M %s
88
// RUN: %clang_cc1 -triple armv7a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s
99
// RUN: %clang_cc1 -triple armv7r %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s
10-
// RUN: %clang_cc1 -triple armv7m %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s
10+
// RUN: %clang_cc1 -triple thumbv7m %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s
1111
// RUN: %clang_cc1 -triple armv8a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s
1212
// RUN: %clang_cc1 -triple armv8r %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s
1313
// RUN: %clang_cc1 -triple armv8.1a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s

clang/test/CodeGen/pr45476.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -triple armv6m-eabi -emit-llvm %s -o - | FileCheck -check-prefix=LIBCALL %s
1+
// RUN: %clang_cc1 -triple thumbv6m-eabi -emit-llvm %s -o - | FileCheck -check-prefix=LIBCALL %s
22
// RUN: %clang_cc1 -triple armv8-eabi -emit-llvm %s -o - | FileCheck -check-prefix=NATIVE %s
33
// PR45476
44

clang/test/Sema/builtins-arm-exclusive-124.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_cc1 -triple armv7m -fsyntax-only -verify %s
2-
// RUN: %clang_cc1 -triple armv8m.main -fsyntax-only -verify %s
1+
// RUN: %clang_cc1 -triple thumbv7m -fsyntax-only -verify %s
2+
// RUN: %clang_cc1 -triple thumbv8m.main -fsyntax-only -verify %s
33
// RUN: %clang_cc1 -triple armv8.1m.main -fsyntax-only -verify %s
44

55
// All these architecture versions provide 1-, 2- or 4-byte exclusive accesses,

clang/test/Sema/builtins-arm-exclusive-none.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -triple armv6m -fsyntax-only -verify %s
1+
// RUN: %clang_cc1 -triple thumbv6m -fsyntax-only -verify %s
22

33
// Armv6-M does not support exclusive loads/stores at all, so all uses of
44
// __builtin_arm_ldrex[d] and __builtin_arm_strex[d] is forbidden.

0 commit comments

Comments
 (0)