summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Driver/ToolChains.cpp8
-rw-r--r--clang/test/Driver/arch-armv7k.c10
2 files changed, 11 insertions, 7 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index d1ce3f4f1f1..ed223219f65 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -1053,12 +1053,8 @@ bool Darwin::UseSjLjExceptions(const ArgList &Args) const {
getTriple().getArch() != llvm::Triple::thumb)
return false;
- // We can't check directly for watchOS here. ComputeLLVMTriple only
- // fills in the ArchName correctly.
- llvm::Triple Triple(ComputeLLVMTriple(Args));
- return !(Triple.getArchName() == "armv7k" ||
- Triple.getArchName() == "thumbv7k");
-
+ // Only watchOS uses the new DWARF/Compact unwinding method.
+ return !isTargetWatchOS();
}
bool MachO::isPICDefault() const { return true; }
diff --git a/clang/test/Driver/arch-armv7k.c b/clang/test/Driver/arch-armv7k.c
index 190d8999ab6..f5c33cfd9f5 100644
--- a/clang/test/Driver/arch-armv7k.c
+++ b/clang/test/Driver/arch-armv7k.c
@@ -1,5 +1,13 @@
-// Tests that make sure armv7k is mapped to the correct CPU
+// Tests that make sure armv7k is mapped to the correct CPU and ABI choices
// RUN: %clang -target x86_64-apple-macosx10.9 -arch armv7k -c %s -### 2>&1 | FileCheck %s
// CHECK: "-cc1"{{.*}} "-target-cpu" "cortex-a7"
// CHECK-NOT: "-fsjlj-exceptions"
+
+// "thumbv7k-apple-ios" is a bit of a weird triple, but since the backend is
+// going to choose to use sjlj-based exceptions for it, the front-end needs to
+// match.
+
+// RUN: %clang -target x86_64-apple-macosx10.9 -arch armv7k -miphoneos-version-min=9.0 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SJLJ
+// CHECK-SJLJ: "-cc1"{{.*}} "-target-cpu" "cortex-a7"
+// CHECK-SJLJ: "-fsjlj-exceptions"
OpenPOWER on IntegriCloud