diff options
author | Oliver Stannard <oliver.stannard@arm.com> | 2016-09-15 08:55:41 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@arm.com> | 2016-09-15 08:55:41 +0000 |
commit | 97a3c35443da90a80d7aead1252a9492e5dea57a (patch) | |
tree | c6b7967ea32627c2bc1304ec9541b272828fc96a | |
parent | 2540a553e5ab66c2fa15b52edc0c22669ef53f15 (diff) | |
download | bcm5719-llvm-97a3c35443da90a80d7aead1252a9492e5dea57a.tar.gz bcm5719-llvm-97a3c35443da90a80d7aead1252a9492e5dea57a.zip |
[ARM] ARM-specific attributes should be accepted for big-endian
The ARM-specific C attributes (currently just interrupt) need to check
for both the big- and little-endian versions of the triples, so that
they are accepted for both big and little endian targets.
TargetWindows and TargetMicrosoftCXXABI also only use the little-endian
triples, but this is correct as windows is not supported on big-endian
ARM targets (and this is asserted in lib/Basic/Targets.cpp).
Differential Revision: https://reviews.llvm.org/D24245
llvm-svn: 281596
-rw-r--r-- | clang/include/clang/Basic/Attr.td | 2 | ||||
-rw-r--r-- | clang/test/Sema/arm-interrupt-attr.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index b72222fc5cf..2424d7ada98 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -254,7 +254,7 @@ class TargetArch<list<string> arches> { list<string> OSes; list<string> CXXABIs; } -def TargetARM : TargetArch<["arm", "thumb"]>; +def TargetARM : TargetArch<["arm", "thumb", "armeb", "thumbeb"]>; def TargetMips : TargetArch<["mips", "mipsel"]>; def TargetMSP430 : TargetArch<["msp430"]>; def TargetX86 : TargetArch<["x86"]>; diff --git a/clang/test/Sema/arm-interrupt-attr.c b/clang/test/Sema/arm-interrupt-attr.c index e8f21ada7fc..b9684f0b46c 100644 --- a/clang/test/Sema/arm-interrupt-attr.c +++ b/clang/test/Sema/arm-interrupt-attr.c @@ -1,4 +1,7 @@ // RUN: %clang_cc1 %s -triple arm-apple-darwin -verify -fsyntax-only +// RUN: %clang_cc1 %s -triple thumb-apple-darwin -verify -fsyntax-only +// RUN: %clang_cc1 %s -triple armeb-none-eabi -verify -fsyntax-only +// RUN: %clang_cc1 %s -triple thumbeb-none-eabi -verify -fsyntax-only __attribute__((interrupt(IRQ))) void foo() {} // expected-error {{'interrupt' attribute requires a string}} __attribute__((interrupt("irq"))) void foo1() {} // expected-warning {{'interrupt' attribute argument not supported: irq}} |