]> granicus.if.org Git - clang/commitdiff
Update clang support for -mexecute-only/-mpure-code for backend change to use subtarg...
authorEric Christopher <echristo@gmail.com>
Sat, 1 Jul 2017 02:55:23 +0000 (02:55 +0000)
committerEric Christopher <echristo@gmail.com>
Sat, 1 Jul 2017 02:55:23 +0000 (02:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306928 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/Arch/ARM.cpp
test/CodeGen/arm-execute-only.c [new file with mode: 0644]
test/Driver/arm-execute-only.c

index 4eac976201145dccba260a6a3ac3aed5d3f5c9c5..8cafd3c74bfb7a4f031108bc91b2b1c24011ec23 100644 (file)
@@ -392,9 +392,7 @@ void arm::getARMTargetFeatures(const ToolChain &TC,
           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");
       }
     }
   }
diff --git a/test/CodeGen/arm-execute-only.c b/test/CodeGen/arm-execute-only.c
new file mode 100644 (file)
index 0000000..6d88ff6
--- /dev/null
@@ -0,0 +1,78 @@
+// 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
+
+
+// -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
+
+// CHECK-NO-EXECUTE-ONLY-NOT: "+execute-only"
+// CHECK-EXECUTE-ONLY: "+execute-only"
+
+void a() {}
index a4854485e1e446caeab3f5ba3d192ea1feb0c84d..c226a7f3b4b192813dd43e0ddea07692f79cf5d4 100644 (file)
@@ -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