Author: echristo Date: Fri Jun 30 19:55:23 2017 New Revision: 306928 URL: http://llvm.org/viewvc/llvm-project?rev=306928&view=rev Log: Update clang support for -mexecute-only/-mpure-code for backend change to use subtarget feature rather than command line option.
Added: cfe/trunk/test/CodeGen/arm-execute-only.c - copied, changed from r306926, cfe/trunk/test/Driver/arm-execute-only.c Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp cfe/trunk/test/Driver/arm-execute-only.c Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp?rev=306928&r1=306927&r2=306928&view=diff ============================================================================== --- cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp Fri Jun 30 19:55:23 2017 @@ -392,9 +392,7 @@ void arm::getARMTargetFeatures(const Too if (B->getOption().matches(options::OPT_mlong_calls)) 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"); + Features.push_back("+execute-only"); } } } Copied: cfe/trunk/test/CodeGen/arm-execute-only.c (from r306926, cfe/trunk/test/Driver/arm-execute-only.c) URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-execute-only.c?p2=cfe/trunk/test/CodeGen/arm-execute-only.c&p1=cfe/trunk/test/Driver/arm-execute-only.c&r1=306926&r2=306928&rev=306928&view=diff ============================================================================== --- cfe/trunk/test/Driver/arm-execute-only.c (original) +++ cfe/trunk/test/CodeGen/arm-execute-only.c Fri Jun 30 19:55:23 2017 @@ -34,15 +34,6 @@ // RUN: %clang -target armv8m.main-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY -// RUN: not %clang -c -target thumbv6m-eabi -mexecute-only %s 2>&1 | \ -// RUN: FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s - -// RUN: not %clang -target armv8m.main-eabi -mexecute-only -mno-movt %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-NO-MOVT - -// RUN: not %clang -target armv8m.main-eabi -mexecute-only -mlong-calls %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-LONG-CALLS - // -mpure-code flag for GCC compatibility // RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ @@ -81,23 +72,7 @@ // RUN: %clang -target armv8m.main-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY -// RUN: not %clang -c -target thumbv6m-eabi -mpure-code %s 2>&1 | \ -// RUN: FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s - -// RUN: not %clang -target armv8m.main-eabi -mpure-code -mno-movt %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-NO-MOVT - -// RUN: not %clang -target armv8m.main-eabi -mpure-code -mlong-calls %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-LONG-CALLS +// CHECK-NO-EXECUTE-ONLY-NOT: "+execute-only" +// CHECK-EXECUTE-ONLY: "+execute-only" -// RUN: %clang -target armv7m-eabi -x assembler -mexecute-only %s -c -### 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY -check-prefix CHECK-NO-EXECUTE-ONLY-ASM - -// -// 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' -// CHECK-EXECUTE-ONLY-LONG-CALLS: error: option '-mexecute-only' cannot be specified with '-mlong-calls' -// CHECK-NO-EXECUTE-ONLY-ASM: warning: argument unused during compilation: '-mexecute-only' +void a() {} Modified: cfe/trunk/test/Driver/arm-execute-only.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-execute-only.c?rev=306928&r1=306927&r2=306928&view=diff ============================================================================== --- cfe/trunk/test/Driver/arm-execute-only.c (original) +++ cfe/trunk/test/Driver/arm-execute-only.c Fri Jun 30 19:55:23 2017 @@ -1,39 +1,3 @@ -// RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv6t2-eabi -### -mexecute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv6t2-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### -mexecute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### -mexecute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### -mexecute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - // RUN: not %clang -c -target thumbv6m-eabi -mexecute-only %s 2>&1 | \ // RUN: FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s @@ -45,42 +9,6 @@ // -mpure-code flag for GCC compatibility -// RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv6t2-eabi -### -mpure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv6t2-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### -mpure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv7m-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### -mpure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv8m.base-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### -mpure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY - -// RUN: %clang -target armv8m.main-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY - // RUN: not %clang -c -target thumbv6m-eabi -mpure-code %s 2>&1 | \ // RUN: FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits