[cfe-commits] [Patch] Initial FreeBSD ARM support

Dmitri Gribenko gribozavr at gmail.com
Tue Nov 27 14:02:25 PST 2012


On Mon, Nov 26, 2012 at 11:15 AM, Andrew Turner <andrew at fubar.geek.nz> wrote:
> On Sat, 24 Nov 2012 22:23:40 +0200
> Dmitri Gribenko <gribozavr at gmail.com> wrote:
>
>> On Sat, Nov 24, 2012 at 10:47 AM, Andrew Turner
>> <andrew at fubar.geek.nz> wrote:
>> > Hello,
>> >
>> > The attached patch adds initial support to clang for FreeBSD on ARM.
>> > I've tested this on FreeBSD's integrated clang 3.1 and forward
>> > ported the changes to clang's trunk.
>>
>> Hi Andrew,
>>
>> I am not an expert on this part of Clang, but this definitely needs
>> tests.
>>
> Are you able to point me in the direction of the sort of tests you
> would expect for the patch? I'm not familiar with clang's testing
> framework.

Rafael has already given an advice.  Here's more:

+      Builder.defineMacro("__FreeBSD_ARCH_armv6__");

You might want to add a test to test/Preprocessor/init.c for this.

+  } else if (getToolChain().getArch() == llvm::Triple::arm ||
+             getToolChain().getArch() == llvm::Triple::thumb) {
+    CmdArgs.push_back("-mfpu=softvfp");
+    switch(getToolChain().getTriple().getEnvironment()) {
+    case llvm::Triple::GNUEABI:
+    case llvm::Triple::EABI:
+      break;
+
+    default:
+      CmdArgs.push_back("-matpcs");
+    }

As far as I understand, this could be tested with something like
test/Driver/freebsd-mips-as.c.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list