target-features.m
5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// REQUIRES: x86-registered-target
// REQUIRES: arm-registered-target
// REQUIRES: aarch64-registered-target
// REQUIRES: riscv-registered-target
// RUN: rm -rf %t
// Sanity check one of the compilations.
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s -verify -DSANITY_CHECK
// expected-no-diagnostics
// Check all the targets:
// RUN: not %clang_cc1 -triple armv7-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.aarch32
// RUN: FileCheck %s -check-prefix=AARCH32 < %t.aarch32
// RUN: not %clang_cc1 -triple aarch64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.aarch64
// RUN: FileCheck %s -check-prefix=AARCH64 < %t.aarch64
// RUN: not %clang_cc1 -triple i386-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.x86_32
// RUN: FileCheck %s -check-prefix=X86_32 < %t.x86_32
// RUN: not %clang_cc1 -triple x86_64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.x86_64
// RUN: FileCheck %s -check-prefix=X86_64 < %t.x86_64
// RUN: not %clang_cc1 -triple riscv32-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.riscv32
// RUN: FileCheck %s -check-prefix=RISCV32 < %t.riscv32
// RUN: not %clang_cc1 -triple riscv64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.riscv64
// RUN: FileCheck %s -check-prefix=RISCV64 < %t.riscv64
#ifndef SANITY_CHECK
@import TargetFeatures;
// AARCH32-NOT: module 'TargetFeatures' requires
// AARCH64-NOT: module 'TargetFeatures' requires
// X86_32-NOT: module 'TargetFeatures' requires
// X86_64-NOT: module 'TargetFeatures' requires
// RISCV32-NOT: module 'TargetFeatures' requires
// RISCV64-NOT: module 'TargetFeatures' requires
@import TargetFeatures.arm;
// AARCH32-NOT: module 'TargetFeatures.arm' requires
// AARCH64-NOT: module 'TargetFeatures.arm' requires
// X86_32: module 'TargetFeatures.arm' requires feature 'arm'
// X86_64: module 'TargetFeatures.arm' requires feature 'arm'
// RISCV32: module 'TargetFeatures.arm' requires
// RISCV64: module 'TargetFeatures.arm' requires
@import TargetFeatures.arm.aarch32;
// AARCH32-NOT: module 'TargetFeatures.arm.aarch32' requires
// AARCH64: module 'TargetFeatures.arm.aarch32' requires feature 'aarch32'
// X86_32: module 'TargetFeatures.arm.aarch32' requires feature
// X86_64: module 'TargetFeatures.arm.aarch32' requires feature
// RISCV32: module 'TargetFeatures.arm.aarch32' requires feature
// RISCV64: module 'TargetFeatures.arm.aarch32' requires feature
#endif
@import TargetFeatures.arm.aarch64;
// AARCH32: module 'TargetFeatures.arm.aarch64' requires feature 'aarch64'
// AARCH64-NOT: module 'TargetFeatures.arm.aarch64' requires
// X86_32: module 'TargetFeatures.arm.aarch64' requires feature
// X86_64: module 'TargetFeatures.arm.aarch64' requires feature
// RISCV32: module 'TargetFeatures.arm.aarch64' requires feature
// RISCV64: module 'TargetFeatures.arm.aarch64' requires feature
#ifndef SANITY_CHECK
@import TargetFeatures.x86;
// AARCH32: module 'TargetFeatures.x86' requires feature 'x86'
// AARCH64: module 'TargetFeatures.x86' requires feature 'x86'
// X86_32-NOT: module 'TargetFeatures.x86' requires
// X86_64-NOT: module 'TargetFeatures.x86' requires
// RISCV32: module 'TargetFeatures.x86' requires feature 'x86'
// RISCV64: module 'TargetFeatures.x86' requires feature 'x86'
@import TargetFeatures.x86.x86_32;
// AARCH32: module 'TargetFeatures.x86.x86_32' requires feature
// AARCH64: module 'TargetFeatures.x86.x86_32' requires feature
// X86_32-NOT: module 'TargetFeatures.x86.x86_32' requires
// X86_64: module 'TargetFeatures.x86.x86_32' requires feature 'x86_32'
// RISCV32: module 'TargetFeatures.x86.x86_32' requires feature
// RISCV64: module 'TargetFeatures.x86.x86_32' requires feature
@import TargetFeatures.x86.x86_64;
// AARCH32: module 'TargetFeatures.x86.x86_64' requires feature
// AARCH64: module 'TargetFeatures.x86.x86_64' requires feature
// X86_32: module 'TargetFeatures.x86.x86_64' requires feature 'x86_64'
// X86_64-NOT: module 'TargetFeatures.x86.x86_64' requires
// RISCV32: module 'TargetFeatures.x86.x86_64' requires feature
// RISCV64: module 'TargetFeatures.x86.x86_64' requires feature
@import TargetFeatures.riscv;
// AARCH32: module 'TargetFeatures.riscv' requires feature
// AARCH64: module 'TargetFeatures.riscv' requires feature
// X86_32: module 'TargetFeatures.riscv' requires feature
// X86_64: module 'TargetFeatures.riscv' requires feature
// RISCV32-NOT: module 'TargetFeatures.riscv' requires feature
// RISCV64-NOT: module 'TargetFeatures.riscv' requires feature
@import TargetFeatures.riscv.riscv32;
// AARCH32: module 'TargetFeatures.riscv.riscv32' requires feature
// AARCH64: module 'TargetFeatures.riscv.riscv32' requires feature
// X86_32: module 'TargetFeatures.riscv.riscv32' requires feature
// X86_64: module 'TargetFeatures.riscv.riscv32' requires feature
// RISCV32-NOT: module 'TargetFeatures.riscv.riscv32' requires feature
// RISCV64: module 'TargetFeatures.riscv.riscv32' requires feature 'riscv32'
@import TargetFeatures.riscv.riscv64;
// AARCH32: module 'TargetFeatures.riscv.riscv64' requires feature
// AARCH64: module 'TargetFeatures.riscv.riscv64' requires feature
// X86_32: module 'TargetFeatures.riscv.riscv64' requires feature
// X86_64: module 'TargetFeatures.riscv.riscv64' requires feature
// RISCV32: module 'TargetFeatures.riscv.riscv64' requires feature 'riscv64'
// RISCV64-NOT: module 'TargetFeatures.riscv.riscv64' requires feature
#endif