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