xref: /llvm-project/clang/test/CodeGen/arm-execute-only.c (revision 6f357afee2a1a14ee771d6f1442b6c5bee558ba1)
1*6f357afeSEric Christopher // RUN: %clang -target armv6t2-eabi -### %s 2>&1 \
2*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
3*6f357afeSEric Christopher 
4*6f357afeSEric Christopher // RUN: %clang -target armv6t2-eabi -### -mexecute-only %s 2>&1 \
5*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
6*6f357afeSEric Christopher 
7*6f357afeSEric Christopher // RUN: %clang -target armv6t2-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \
8*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
9*6f357afeSEric Christopher 
10*6f357afeSEric Christopher // RUN: %clang -target armv7m-eabi -### %s 2>&1 \
11*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
12*6f357afeSEric Christopher 
13*6f357afeSEric Christopher // RUN: %clang -target armv7m-eabi -### -mexecute-only %s 2>&1 \
14*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
15*6f357afeSEric Christopher 
16*6f357afeSEric Christopher // RUN: %clang -target armv7m-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \
17*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
18*6f357afeSEric Christopher 
19*6f357afeSEric Christopher // RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \
20*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
21*6f357afeSEric Christopher 
22*6f357afeSEric Christopher // RUN: %clang -target armv8m.base-eabi -### -mexecute-only %s 2>&1 \
23*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
24*6f357afeSEric Christopher 
25*6f357afeSEric Christopher // RUN: %clang -target armv8m.base-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \
26*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
27*6f357afeSEric Christopher 
28*6f357afeSEric Christopher // RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \
29*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
30*6f357afeSEric Christopher 
31*6f357afeSEric Christopher // RUN: %clang -target armv8m.main-eabi -### -mexecute-only %s 2>&1 \
32*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
33*6f357afeSEric Christopher 
34*6f357afeSEric Christopher // RUN: %clang -target armv8m.main-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \
35*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
36*6f357afeSEric Christopher 
37*6f357afeSEric Christopher 
38*6f357afeSEric Christopher // -mpure-code flag for GCC compatibility
39*6f357afeSEric Christopher // RUN: %clang -target armv6t2-eabi -### %s 2>&1 \
40*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
41*6f357afeSEric Christopher 
42*6f357afeSEric Christopher // RUN: %clang -target armv6t2-eabi -### -mpure-code %s 2>&1 \
43*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
44*6f357afeSEric Christopher 
45*6f357afeSEric Christopher // RUN: %clang -target armv6t2-eabi -### -mpure-code -mno-pure-code %s 2>&1 \
46*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
47*6f357afeSEric Christopher 
48*6f357afeSEric Christopher // RUN: %clang -target armv7m-eabi -### %s 2>&1 \
49*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
50*6f357afeSEric Christopher 
51*6f357afeSEric Christopher // RUN: %clang -target armv7m-eabi -### -mpure-code %s 2>&1 \
52*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
53*6f357afeSEric Christopher 
54*6f357afeSEric Christopher // RUN: %clang -target armv7m-eabi -### -mpure-code -mno-pure-code %s 2>&1 \
55*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
56*6f357afeSEric Christopher 
57*6f357afeSEric Christopher // RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \
58*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
59*6f357afeSEric Christopher 
60*6f357afeSEric Christopher // RUN: %clang -target armv8m.base-eabi -### -mpure-code %s 2>&1 \
61*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
62*6f357afeSEric Christopher 
63*6f357afeSEric Christopher // RUN: %clang -target armv8m.base-eabi -### -mpure-code -mno-pure-code %s 2>&1 \
64*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
65*6f357afeSEric Christopher 
66*6f357afeSEric Christopher // RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \
67*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
68*6f357afeSEric Christopher 
69*6f357afeSEric Christopher // RUN: %clang -target armv8m.main-eabi -### -mpure-code %s 2>&1 \
70*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
71*6f357afeSEric Christopher 
72*6f357afeSEric Christopher // RUN: %clang -target armv8m.main-eabi -### -mpure-code -mno-pure-code %s 2>&1 \
73*6f357afeSEric Christopher // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
74*6f357afeSEric Christopher 
75*6f357afeSEric Christopher // CHECK-NO-EXECUTE-ONLY-NOT: "+execute-only"
76*6f357afeSEric Christopher // CHECK-EXECUTE-ONLY: "+execute-only"
77*6f357afeSEric Christopher 
a()78*6f357afeSEric Christopher void a() {}
79