]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Driver/arm-execute-only.c
Vendor import of clang trunk r300422:
[FreeBSD/FreeBSD.git] / test / Driver / arm-execute-only.c
1 // RUN: %clang -target armv6t2-eabi -### %s 2>&1 \
2 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
3
4 // RUN: %clang -target armv6t2-eabi -### -mexecute-only %s 2>&1 \
5 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
6
7 // RUN: %clang -target armv6t2-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \
8 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
9
10 // RUN: %clang -target armv7m-eabi -### %s 2>&1 \
11 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
12
13 // RUN: %clang -target armv7m-eabi -### -mexecute-only %s 2>&1 \
14 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
15
16 // RUN: %clang -target armv7m-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \
17 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
18
19 // RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \
20 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
21
22 // RUN: %clang -target armv8m.base-eabi -### -mexecute-only %s 2>&1 \
23 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
24
25 // RUN: %clang -target armv8m.base-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \
26 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
27
28 // RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \
29 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
30
31 // RUN: %clang -target armv8m.main-eabi -### -mexecute-only %s 2>&1 \
32 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
33
34 // RUN: %clang -target armv8m.main-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \
35 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
36
37 // RUN: not %clang -c -target thumbv6m-eabi -mexecute-only %s 2>&1 | \
38 // RUN:   FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s
39
40 // RUN: not %clang -target armv8m.main-eabi -mexecute-only -mno-movt %s 2>&1 \
41 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-NO-MOVT
42
43 // RUN: not %clang -target armv8m.main-eabi -mexecute-only -mlong-calls %s 2>&1 \
44 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-LONG-CALLS
45
46
47 // -mpure-code flag for GCC compatibility
48 // RUN: %clang -target armv6t2-eabi -### %s 2>&1 \
49 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
50
51 // RUN: %clang -target armv6t2-eabi -### -mpure-code %s 2>&1 \
52 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
53
54 // RUN: %clang -target armv6t2-eabi -### -mpure-code -mno-pure-code %s 2>&1 \
55 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
56
57 // RUN: %clang -target armv7m-eabi -### %s 2>&1 \
58 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
59
60 // RUN: %clang -target armv7m-eabi -### -mpure-code %s 2>&1 \
61 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
62
63 // RUN: %clang -target armv7m-eabi -### -mpure-code -mno-pure-code %s 2>&1 \
64 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
65
66 // RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \
67 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
68
69 // RUN: %clang -target armv8m.base-eabi -### -mpure-code %s 2>&1 \
70 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
71
72 // RUN: %clang -target armv8m.base-eabi -### -mpure-code -mno-pure-code %s 2>&1 \
73 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
74
75 // RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \
76 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
77
78 // RUN: %clang -target armv8m.main-eabi -### -mpure-code %s 2>&1 \
79 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY
80
81 // RUN: %clang -target armv8m.main-eabi -### -mpure-code -mno-pure-code %s 2>&1 \
82 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY
83
84 // RUN: not %clang -c -target thumbv6m-eabi -mpure-code %s 2>&1 | \
85 // RUN:   FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s
86
87 // RUN: not %clang -target armv8m.main-eabi -mpure-code -mno-movt %s 2>&1 \
88 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-NO-MOVT
89
90 // RUN: not %clang -target armv8m.main-eabi -mpure-code -mlong-calls %s 2>&1 \
91 // RUN:    | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-LONG-CALLS
92
93 // RUN: %clang -target armv7m-eabi -x assembler -mexecute-only %s -c -### 2>&1 \
94 // RUN:    | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY -check-prefix CHECK-NO-EXECUTE-ONLY-ASM
95
96 //
97 // CHECK-NO-EXECUTE-ONLY-NOT: "-backend-option" "-arm-execute-only"
98 // CHECK-EXECUTE-ONLY: "-backend-option" "-arm-execute-only"
99
100 // CHECK-EXECUTE-ONLY-NOT-SUPPORTED: error: execute only is not supported for the thumbv6m sub-architecture
101 // CHECK-EXECUTE-ONLY-NO-MOVT: error: option '-mexecute-only' cannot be specified with '-mno-movt'
102 // CHECK-EXECUTE-ONLY-LONG-CALLS: error: option '-mexecute-only' cannot be specified with '-mlong-calls'
103 // CHECK-NO-EXECUTE-ONLY-ASM: warning: argument unused during compilation: '-mexecute-only'