From: Oliver Stannard Date: Thu, 15 Sep 2016 08:55:41 +0000 (+0000) Subject: [ARM] ARM-specific attributes should be accepted for big-endian X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=236cf680351c37657f9a25029d102f17aac2a2d3;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281596 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index b72222fc5c..2424d7ada9 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -254,7 +254,7 @@ class TargetArch arches> { list OSes; list 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/test/Sema/arm-interrupt-attr.c b/test/Sema/arm-interrupt-attr.c index e8f21ada7f..b9684f0b46 100644 --- a/test/Sema/arm-interrupt-attr.c +++ b/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}}