} else if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6))) {
Features.push_back("+long-calls");
}
+
+ // The kext linker doesn't know how to deal with movw/movt.
+ if (KernelOrKext)
+ Features.push_back("+no-movt");
}
void Clang::AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs,
if (KernelOrKext) {
CmdArgs.push_back("-backend-option");
CmdArgs.push_back("-arm-strict-align");
-
- // The kext linker doesn't know how to deal with movw/movt.
- CmdArgs.push_back("-backend-option");
- CmdArgs.push_back("-arm-use-movt=0");
}
// -mkernel implies -mstrict-align; don't add the redundant option.
--- /dev/null
+// RUN: %clang_cc1 -triple thumbv7-apple-ios5 -target-feature +no-movt -emit-llvm -o - %s | FileCheck -check-prefix=NO-MOVT %s
+// RUN: %clang_cc1 -triple thumbv7-apple-ios5 -emit-llvm -o - %s | FileCheck -check-prefix=MOVT %s
+
+// NO-MOVT: attributes #0 = { {{.*}} "target-features"="+no-movt"
+// MOVT-NOT: attributes #0 = { {{.*}} "target-features"="+no-movt"
+
+int foo1(int a) { return a; }
--- /dev/null
+// RUN: %clang -target armv7-apple-darwin -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix CHECK-DEFAULT
+
+// RUN: %clang -target armv7-apple-darwin -mkernel -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix CHECK-KERNEL
+
+// CHECK-DEFAULT-NOT: "-target-feature" "+no-movt"
+
+// CHECK-KERNEL: "-target-feature" "+no-movt"