diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 253a25695feb..251187a25c1a 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1158,6 +1158,7 @@ static void getARMTargetFeatures(const ToolChain &TC, D.Diag(diag::err_opt_not_valid_with_opt) << A->getAsString(Args) << B->getAsString(Args); } + CmdArgs.push_back("-backend-option"); CmdArgs.push_back("-arm-execute-only"); } } diff --git a/clang/test/Driver/arm-execute-only.c b/clang/test/Driver/arm-execute-only.c index f564594b834b..7010bbc837a0 100644 --- a/clang/test/Driver/arm-execute-only.c +++ b/clang/test/Driver/arm-execute-only.c @@ -91,8 +91,8 @@ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-LONG-CALLS // -// CHECK-NO-EXECUTE-ONLY-NOT: "-arm-execute-only" -// CHECK-EXECUTE-ONLY: "-arm-execute-only" +// CHECK-NO-EXECUTE-ONLY-NOT: "-backend-option" "-arm-execute-only" +// CHECK-EXECUTE-ONLY: "-backend-option" "-arm-execute-only" // CHECK-EXECUTE-ONLY-NOT-SUPPORTED: error: execute only is not supported for the thumbv6m sub-architecture // CHECK-EXECUTE-ONLY-NO-MOVT: error: option '-mexecute-only' cannot be specified with '-mno-movt'