[clang] Don't define predefined macros multiple times
authorJohn Brawn <john.brawn@arm.com>
Wed, 17 May 2023 15:52:26 +0000 (16:52 +0100)
committerJohn Brawn <john.brawn@arm.com>
Wed, 24 May 2023 16:28:41 +0000 (17:28 +0100)
Fix several instances of macros being defined multiple times
in several targets. Most of these are just simple duplication in a
TargetInfo or OSTargetInfo of things already defined in
InitializePredefinedMacros or InitializeStandardPredefinedMacros,
but there are a few that aren't:
 * AArch64 defines a couple of feature macros for armv8.1a that are
   handled generically by getTargetDefines.
 * CSKY needs to take care when CPUName and ArchName are the same.
 * Many os/target combinations result in __ELF__ being defined twice.
   Instead define __ELF__ just once in InitPreprocessor based on
   the Triple, which already knows what the object format is based
   on os and target.

These changes shouldn't change the final result of which macros are
defined, with the exception of the changes to __ELF__ where if you
explicitly specify the object type in the triple then this affects
if __ELF__ is defined, e.g. --target=i686-windows-elf results in it
being defined where it wasn't before, but this is more accurate as an
ELF file is in fact generated.

Differential Revision: https://reviews.llvm.org/D150966

13 files changed:
clang/lib/Basic/Targets/AArch64.cpp
clang/lib/Basic/Targets/ARM.cpp
clang/lib/Basic/Targets/AVR.cpp
clang/lib/Basic/Targets/CSKY.cpp
clang/lib/Basic/Targets/Hexagon.cpp
clang/lib/Basic/Targets/Le64.cpp
clang/lib/Basic/Targets/MSP430.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Basic/Targets/RISCV.cpp
clang/lib/Basic/Targets/VE.cpp
clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Preprocessor/init-ve.c
clang/test/Preprocessor/predefined-macros-no-warnings.c [new file with mode: 0644]

index 3840139..ea9995f 100644 (file)
@@ -238,8 +238,6 @@ void AArch64TargetInfo::fillValidCPUList(
 void AArch64TargetInfo::getTargetDefinesARMV81A(const LangOptions &Opts,
                                                 MacroBuilder &Builder) const {
   Builder.defineMacro("__ARM_FEATURE_QRDMX", "1");
-  Builder.defineMacro("__ARM_FEATURE_ATOMICS", "1");
-  Builder.defineMacro("__ARM_FEATURE_CRC32", "1");
 }
 
 void AArch64TargetInfo::getTargetDefinesARMV82A(const LangOptions &Opts,
@@ -335,16 +333,6 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
   Builder.defineMacro("__aarch64__");
   // Inline assembly supports AArch64 flag outputs.
   Builder.defineMacro("__GCC_ASM_FLAG_OUTPUTS__");
-  // For bare-metal.
-  if (getTriple().getOS() == llvm::Triple::UnknownOS &&
-      getTriple().isOSBinFormatELF())
-    Builder.defineMacro("__ELF__");
-
-  // Target properties.
-  if (!getTriple().isOSWindows() && getTriple().isArch64Bit()) {
-    Builder.defineMacro("_LP64");
-    Builder.defineMacro("__LP64__");
-  }
 
   std::string CodeModel = getTargetOpts().CodeModel;
   if (CodeModel == "default")
@@ -1523,7 +1511,6 @@ void DarwinAArch64TargetInfo::getOSDefines(const LangOptions &Opts,
   else
     Builder.defineMacro("__ARM64_ARCH_8__");
   Builder.defineMacro("__ARM_NEON__");
-  Builder.defineMacro("__LITTLE_ENDIAN__");
   Builder.defineMacro("__REGISTER_PREFIX__", "");
   Builder.defineMacro("__arm64", "1");
   Builder.defineMacro("__arm64__", "1");
index 588357c..6a57261 100644 (file)
@@ -711,10 +711,9 @@ void ARMTargetInfo::getTargetDefines(const LangOptions &Opts,
   // For bare-metal none-eabi.
   if (getTriple().getOS() == llvm::Triple::UnknownOS &&
       (getTriple().getEnvironment() == llvm::Triple::EABI ||
-       getTriple().getEnvironment() == llvm::Triple::EABIHF)) {
-    Builder.defineMacro("__ELF__");
-    if (Opts.CPlusPlus)
-      Builder.defineMacro("_GNU_SOURCE");
+       getTriple().getEnvironment() == llvm::Triple::EABIHF) &&
+      Opts.CPlusPlus) {
+    Builder.defineMacro("_GNU_SOURCE");
   }
 
   // Target properties.
index 5c75bae..85ca4bc 100644 (file)
@@ -450,7 +450,6 @@ void AVRTargetInfo::getTargetDefines(const LangOptions &Opts,
   Builder.defineMacro("AVR");
   Builder.defineMacro("__AVR");
   Builder.defineMacro("__AVR__");
-  Builder.defineMacro("__ELF__");
 
   if (ABI == "avrtiny")
     Builder.defineMacro("__AVR_TINY__", "1");
index f272bed..851f27d 100644 (file)
@@ -33,7 +33,6 @@ bool CSKYTargetInfo::setCPU(const std::string &Name) {
 
 void CSKYTargetInfo::getTargetDefines(const LangOptions &Opts,
                                       MacroBuilder &Builder) const {
-  Builder.defineMacro("__ELF__");
   Builder.defineMacro("__csky__", "2");
   Builder.defineMacro("__CSKY__", "2");
   Builder.defineMacro("__ckcore__", "2");
@@ -52,8 +51,10 @@ void CSKYTargetInfo::getTargetDefines(const LangOptions &Opts,
 
   Builder.defineMacro("__" + ArchName.upper() + "__");
   Builder.defineMacro("__" + ArchName.lower() + "__");
-  Builder.defineMacro("__" + CPUName.upper() + "__");
-  Builder.defineMacro("__" + CPUName.lower() + "__");
+  if (ArchName != CPUName) {
+    Builder.defineMacro("__" + CPUName.upper() + "__");
+    Builder.defineMacro("__" + CPUName.lower() + "__");
+  }
 
   // TODO: Add support for BE if BE was supported later
   StringRef endian = "__cskyLE__";
index 0b98c48..ac747e3 100644 (file)
@@ -24,8 +24,6 @@ void HexagonTargetInfo::getTargetDefines(const LangOptions &Opts,
   Builder.defineMacro("__qdsp6__", "1");
   Builder.defineMacro("__hexagon__", "1");
 
-  Builder.defineMacro("__ELF__");
-
   // The macro __HVXDBL__ is deprecated.
   bool DefineHvxDbl = false;
 
index 5c961ff..f7afa0e 100644 (file)
@@ -27,5 +27,4 @@ void Le64TargetInfo::getTargetDefines(const LangOptions &Opts,
                                       MacroBuilder &Builder) const {
   DefineStd(Builder, "unix", Opts);
   defineCPUMacros(Builder, "le64", /*Tuning=*/false);
-  Builder.defineMacro("__ELF__");
 }
index de8704f..844f5d3 100644 (file)
@@ -29,6 +29,5 @@ void MSP430TargetInfo::getTargetDefines(const LangOptions &Opts,
                                         MacroBuilder &Builder) const {
   Builder.defineMacro("MSP430");
   Builder.defineMacro("__MSP430__");
-  Builder.defineMacro("__ELF__");
   // FIXME: defines for different 'flavours' of MCU
 }
index cb2a68f..445718e 100644 (file)
@@ -41,12 +41,9 @@ protected:
   void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
                     MacroBuilder &Builder) const override {
     Builder.defineMacro("__CloudABI__");
-    Builder.defineMacro("__ELF__");
 
     // CloudABI uses ISO/IEC 10646:2012 for wchar_t, char16_t and char32_t.
     Builder.defineMacro("__STDC_ISO_10646__", "201206L");
-    Builder.defineMacro("__STDC_UTF_16__");
-    Builder.defineMacro("__STDC_UTF_32__");
   }
 
 public:
@@ -61,7 +58,6 @@ protected:
                     MacroBuilder &Builder) const override {
     // Ananas defines
     Builder.defineMacro("__Ananas__");
-    Builder.defineMacro("__ELF__");
   }
 
 public:
@@ -177,7 +173,6 @@ protected:
     // DragonFly defines; list based off of gcc output
     Builder.defineMacro("__DragonFly__");
     Builder.defineMacro("__DragonFly_cc_version", "100001");
-    Builder.defineMacro("__ELF__");
     Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
     Builder.defineMacro("__tune_i386__");
     DefineStd(Builder, "unix", Opts);
@@ -222,7 +217,6 @@ protected:
     Builder.defineMacro("__FreeBSD_cc_version", Twine(CCVersion));
     Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
     DefineStd(Builder, "unix", Opts);
-    Builder.defineMacro("__ELF__");
 
     // On FreeBSD, wchar_t contains the number of the code point as
     // used by the character set of the locale. These character sets are
@@ -274,7 +268,6 @@ protected:
     DefineStd(Builder, "unix", Opts);
     Builder.defineMacro("__FreeBSD_kernel__");
     Builder.defineMacro("__GLIBC__");
-    Builder.defineMacro("__ELF__");
     if (Opts.POSIXThreads)
       Builder.defineMacro("_REENTRANT");
     if (Opts.CPlusPlus)
@@ -293,7 +286,6 @@ protected:
                     MacroBuilder &Builder) const override {
     // Haiku defines; list based off of gcc output
     Builder.defineMacro("__HAIKU__");
-    Builder.defineMacro("__ELF__");
     DefineStd(Builder, "unix", Opts);
     if (this->HasFloat128)
       Builder.defineMacro("__FLOAT128__");
@@ -330,7 +322,6 @@ protected:
     Builder.defineMacro("__gnu_hurd__");
     Builder.defineMacro("__MACH__");
     Builder.defineMacro("__GLIBC__");
-    Builder.defineMacro("__ELF__");
     if (Opts.POSIXThreads)
       Builder.defineMacro("_REENTRANT");
     if (Opts.CPlusPlus)
@@ -355,7 +346,6 @@ protected:
     Builder.defineMacro("_EM_LSIZE", "4");
     Builder.defineMacro("_EM_FSIZE", "4");
     Builder.defineMacro("_EM_DSIZE", "8");
-    Builder.defineMacro("__ELF__");
     DefineStd(Builder, "unix", Opts);
   }
 
@@ -372,7 +362,6 @@ protected:
     // Linux defines; list based off of gcc output
     DefineStd(Builder, "unix", Opts);
     DefineStd(Builder, "linux", Opts);
-    Builder.defineMacro("__ELF__");
     if (Triple.isAndroid()) {
       Builder.defineMacro("__ANDROID__", "1");
       this->PlatformName = "android";
@@ -434,7 +423,6 @@ protected:
     // NetBSD defines; list based off of gcc output
     Builder.defineMacro("__NetBSD__");
     Builder.defineMacro("__unix__");
-    Builder.defineMacro("__ELF__");
     if (Opts.POSIXThreads)
       Builder.defineMacro("_REENTRANT");
   }
@@ -456,7 +444,6 @@ protected:
 
     Builder.defineMacro("__OpenBSD__");
     DefineStd(Builder, "unix", Opts);
-    Builder.defineMacro("__ELF__");
     if (Opts.POSIXThreads)
       Builder.defineMacro("_REENTRANT");
     if (this->HasFloat128)
@@ -502,10 +489,8 @@ protected:
   void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
                     MacroBuilder &Builder) const override {
     // PS3 PPU defines.
-    Builder.defineMacro("__PPC__");
     Builder.defineMacro("__PPU__");
     Builder.defineMacro("__CELLOS_LV2__");
-    Builder.defineMacro("__ELF__");
     Builder.defineMacro("__LP32__");
     Builder.defineMacro("_ARCH_PPC64");
     Builder.defineMacro("__powerpc64__");
@@ -533,7 +518,6 @@ protected:
     Builder.defineMacro("__FreeBSD_cc_version", "900001");
     Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
     DefineStd(Builder, "unix", Opts);
-    Builder.defineMacro("__ELF__");
     Builder.defineMacro("__SCE__");
     Builder.defineMacro("__STDC_NO_COMPLEX__");
     Builder.defineMacro("__STDC_NO_THREADS__");
@@ -608,7 +592,6 @@ protected:
     // RTEMS defines; list based off of gcc output
 
     Builder.defineMacro("__rtems__");
-    Builder.defineMacro("__ELF__");
     if (Opts.CPlusPlus)
       Builder.defineMacro("_GNU_SOURCE");
   }
@@ -643,7 +626,6 @@ protected:
                     MacroBuilder &Builder) const override {
     DefineStd(Builder, "sun", Opts);
     DefineStd(Builder, "unix", Opts);
-    Builder.defineMacro("__ELF__");
     Builder.defineMacro("__svr4__");
     Builder.defineMacro("__SVR4");
     // Solaris headers require _XOPEN_SOURCE to be set to 600 for C99 and
@@ -874,7 +856,6 @@ protected:
       Builder.defineMacro("_GNU_SOURCE");
 
     DefineStd(Builder, "unix", Opts);
-    Builder.defineMacro("__ELF__");
     Builder.defineMacro("__native_client__");
   }
 
@@ -921,7 +902,6 @@ protected:
   void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
                     MacroBuilder &Builder) const override {
     Builder.defineMacro("__Fuchsia__");
-    Builder.defineMacro("__ELF__");
     if (Opts.POSIXThreads)
       Builder.defineMacro("_REENTRANT");
     // Required by the libc++ locale support.
@@ -1016,8 +996,6 @@ protected:
     // Linux defines; list based off of gcc output
     DefineStd(Builder, "unix", Opts);
 
-    Builder.defineMacro("__ELF__");
-
     // Generic OHOS target defines
     if (Triple.isOHOSFamily()) {
       Builder.defineMacro("__OHOS_FAMILY__", "1");
index 5318cf5..94c894d 100644 (file)
@@ -124,7 +124,6 @@ static unsigned getVersionValue(unsigned MajorVersion, unsigned MinorVersion) {
 
 void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts,
                                        MacroBuilder &Builder) const {
-  Builder.defineMacro("__ELF__");
   Builder.defineMacro("__riscv");
   bool Is64Bit = getTriple().getArch() == llvm::Triple::riscv64;
   Builder.defineMacro("__riscv_xlen", Is64Bit ? "64" : "32");
index a223b65..67cae8f 100644 (file)
@@ -26,14 +26,8 @@ static constexpr Builtin::Info BuiltinInfo[] = {
 
 void VETargetInfo::getTargetDefines(const LangOptions &Opts,
                                     MacroBuilder &Builder) const {
-  Builder.defineMacro("_LP64", "1");
-  Builder.defineMacro("unix", "1");
-  Builder.defineMacro("__unix__", "1");
-  Builder.defineMacro("__linux__", "1");
   Builder.defineMacro("__ve", "1");
   Builder.defineMacro("__ve__", "1");
-  Builder.defineMacro("__STDC_HOSTED__", "1");
-  Builder.defineMacro("__STDC__", "1");
   Builder.defineMacro("__NEC__", "1");
   // FIXME: define __FAST_MATH__ 1 if -ffast-math is enabled
   // FIXME: define __OPTIMIZE__ n if -On is enabled
index 8082a19..34b478c 100644 (file)
@@ -1299,6 +1299,10 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
     Builder.defineMacro("__GLIBCXX_BITSIZE_INT_N_0", "128");
   }
 
+  // ELF targets define __ELF__
+  if (TI.getTriple().isOSBinFormatELF())
+    Builder.defineMacro("__ELF__");
+
   // Get other target #defines.
   TI.getTargetDefines(LangOpts, Builder);
 }
index b3ff47d..13bdb12 100644 (file)
@@ -2,9 +2,11 @@
 /// REQUIRES: ve-registered-target
 
 // RUN: %clang_cc1 -E -dM -triple=ve < /dev/null | \
-// RUN:     FileCheck -match-full-lines -check-prefix VE %s
+// RUN:     FileCheck -match-full-lines -check-prefixes=VE,VE-HOSTED %s
+// RUN: %clang_cc1 -E -dM -triple=ve -ffreestanding < /dev/null | \
+// RUN:     FileCheck -match-full-lines -check-prefixes=VE,VE-FREESTANDING %s
 // RUN: %clang_cc1 -x c++ -E -dM -triple=ve < /dev/null | \
-// RUN:     FileCheck -match-full-lines -check-prefix VE -check-prefix VE-CXX %s
+// RUN:     FileCheck -match-full-lines -check-prefixes=VE,VE-HOSTED,VE-CXX %s
 //
 // VE:#define _LP64 1
 // VE:#define __BIGGEST_ALIGNMENT__ 8
 // VE:#define __SIZE_TYPE__ long unsigned int
 // VE:#define __SIZE_WIDTH__ 64
 // VE-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL
-// VE:#define __STDC_HOSTED__ 1
+// VE-HOSTED:#define __STDC_HOSTED__ 1
+// VE-FREESTANDING:#define __STDC_HOSTED__ 0
 // VE:#define __UINT16_C_SUFFIX__
 // VE:#define __UINT16_FMTX__ "hX"
 // VE:#define __UINT16_FMTo__ "ho"
diff --git a/clang/test/Preprocessor/predefined-macros-no-warnings.c b/clang/test/Preprocessor/predefined-macros-no-warnings.c
new file mode 100644 (file)
index 0000000..06f96dd
--- /dev/null
@@ -0,0 +1,199 @@
+// Check that the predefined macros don't contain anything that causes a
+// warning, which needs -Wsystem-headers to detect as the predefined macros
+// are in the <built-in> file which is treated as a system header and so has
+// warnings suppressed by default.
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arc
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple xcore
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple hexagon
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple hexagon-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple lanai
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64_32-darwin
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-darwin
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-cloudabi
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-fuchsia
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-linux-openhos
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-win32-gnu
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64-win32-msvc
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64_be
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64_be-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64_be-fuchsia
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64_be-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple aarch64_be-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-darwin
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-cloudabi
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-fuchsia
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-linux-openhos
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-liteos
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-nacl
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-win32-cygnus
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-win32-gnu
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-win32-itanium
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple arm-win32-msvc
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple armeb
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple armeb-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple armeb-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple armeb-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple armeb-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple armeb-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple avr
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple bpfeb
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple bpfel
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple msp430
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mipsel
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mipsel-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mipsel-linux-openhos
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mipsel-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mipsel-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mipsel-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mipsel-nacl
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64el
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64el-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64el-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64el-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64el-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple mips64el-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple m68k
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple m68k-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple m68k-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple le32-nacl
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple le64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc-aix
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppcle
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppcle-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppcle-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64-lv2
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64-aix
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64le-
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64le-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64le-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64le-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ppc64le-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple nvptx
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple nvptx64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple amdgcn
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple r600
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv32
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv32-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv32-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv64-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv64-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv64-fuchsia
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv64-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple riscv64-linux-openhos
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparc
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparc-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparc-solaris
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparc-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparc-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcel
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcel-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcel-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcel-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9-solaris
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9-systemz
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple sparcv9-zos
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple tce
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple tcele
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-darwin
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-ananas
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-cloudabi
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-linux-android
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-dragonfly
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-fuchsia
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-kfreebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-minix
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-solaris
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-win32-cygnus
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-win32-gnu
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-win32-itanium
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-win32-msvc
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-haiku
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-rtems
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-nacl
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-elfiamcu
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple i686-hurd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-darwin
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-ananas
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-cloudabi
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-linux-android
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-linux-openhos
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-dragonfly
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-netbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-openbsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-freebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-fuchsia
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-kfreebsd
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-solaris
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-win32cygnus
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-win32gnu
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-win32msvc
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-haiku
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-nacl
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-ps4
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple x86_64-ps5
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple spir
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple spir64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple spirv32
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple spirv64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple wasm32
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple wasm32-wasi
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple wasm32-emscripten
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple wasm64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple wasm64-wasi
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple wasm64-emscripten
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple dxil
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple renderscript32
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple renderscript64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple ve
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple csky
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple csky-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple loongarch32
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple loongarch32-linux
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple loongarch64
+// RUN: %clang_cc1 %s -Eonly -Wsystem-headers -Werror -triple loongarch64-linux