From 06b306a1c1be31765c8eb23a3561a040215a52cd Mon Sep 17 00:00:00 2001
From: Ed Schouten <ed@nuxi.nl>
Date: Wed, 16 Nov 2016 10:18:17 +0000
Subject: [PATCH] Merge r280672, per bug 30839:

  Add support for targeting armv6-unknown-cloudabi-eabihf.

  I'm in the progress of adding ARMv6 support to CloudABI. On the compiler
  side, everything seems to work properly with this tiny change applied.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_39@287093 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Basic/Targets.cpp    | 2 ++
 test/Preprocessor/init.c | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 7ec06bb17e3..7795fc87b1f 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -8170,6 +8170,8 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple,
       return new DarwinARMTargetInfo(Triple, Opts);
 
     switch (os) {
+    case llvm::Triple::CloudABI:
+      return new CloudABITargetInfo<ARMleTargetInfo>(Triple, Opts);
     case llvm::Triple::Linux:
       return new LinuxTargetInfo<ARMleTargetInfo>(Triple, Opts);
     case llvm::Triple::FreeBSD:
diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c
index f7c320b7226..adf5c778767 100644
--- a/test/Preprocessor/init.c
+++ b/test/Preprocessor/init.c
@@ -1975,6 +1975,11 @@
 // ARMEABIHARDFP:#define __arm 1
 // ARMEABIHARDFP:#define __arm__ 1
 
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=armv6-unknown-cloudabi-eabihf < /dev/null | FileCheck -match-full-lines -check-prefix ARMV6-CLOUDABI %s
+//
+// ARMV6-CLOUDABI:#define __CloudABI__ 1
+// ARMV6-CLOUDABI:#define __arm__ 1
+
 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-netbsd-eabi < /dev/null | FileCheck -match-full-lines -check-prefix ARM-NETBSD %s
 //
 // ARM-NETBSD-NOT:#define _LP64
-- 
GitLab