From c48a84a96b1df70efe77b6c2466b9c8471df7bab Mon Sep 17 00:00:00 2001 From: chenli Date: Tue, 8 Nov 2022 10:43:36 +0800 Subject: [PATCH] Release 13.0.1-1.0.2.an8 [LoongArch] Define subtarget feature unaligned-access [compiler-rt] Support LoongArch64 --- 0002-pkg_an8_clang_13.0.1-1.0.2.patch | 2380 +++++++++++++++++++++++++ clang.spec | 10 +- 2 files changed, 2388 insertions(+), 2 deletions(-) create mode 100644 0002-pkg_an8_clang_13.0.1-1.0.2.patch diff --git a/0002-pkg_an8_clang_13.0.1-1.0.2.patch b/0002-pkg_an8_clang_13.0.1-1.0.2.patch new file mode 100644 index 0000000..b75f05e --- /dev/null +++ b/0002-pkg_an8_clang_13.0.1-1.0.2.patch @@ -0,0 +1,2380 @@ +diff --git a/clang/include/clang/Basic/BuiltinsLoongArch.def b/clang/include/clang/Basic/BuiltinsLoongArch.def +index 5606e62db..e51fb1f3c 100644 +--- a/clang/include/clang/Basic/BuiltinsLoongArch.def ++++ b/clang/include/clang/Basic/BuiltinsLoongArch.def +@@ -126,17 +126,17 @@ BUILTIN(__builtin_lsx_vbitsel_v, "V16UcV16UcV16UcV16Uc", "nc") + + BUILTIN(__builtin_lsx_vshuf_b, "V16UcV16UcV16UcV16Uc", "nc") + +-BUILTIN(__builtin_lsx_vldrepl_b, "V16cv*Ii", "nc") +-BUILTIN(__builtin_lsx_vldrepl_h, "V8sv*Ii", "nc") +-BUILTIN(__builtin_lsx_vldrepl_w, "V4iv*Ii", "nc") +-BUILTIN(__builtin_lsx_vldrepl_d, "V2LLiv*Ii", "nc") ++BUILTIN(__builtin_lsx_vldrepl_b, "V16cvC*Ii", "nc") ++BUILTIN(__builtin_lsx_vldrepl_h, "V8svC*Ii", "nc") ++BUILTIN(__builtin_lsx_vldrepl_w, "V4ivC*Ii", "nc") ++BUILTIN(__builtin_lsx_vldrepl_d, "V2LLivC*Ii", "nc") + + BUILTIN(__builtin_lsx_vstelm_b, "vV16Scv*IiUi", "nc") + BUILTIN(__builtin_lsx_vstelm_h, "vV8Ssv*IiUi", "nc") + BUILTIN(__builtin_lsx_vstelm_w, "vV4Siv*IiUi", "nc") + BUILTIN(__builtin_lsx_vstelm_d, "vV2SLLiv*IiUi", "nc") + +-BUILTIN(__builtin_lsx_vldx, "V16Scv*LLi", "nc") ++BUILTIN(__builtin_lsx_vldx, "V16ScvC*LLi", "nc") + BUILTIN(__builtin_lsx_vstx, "vV16Scv*LLi", "nc") + + BUILTIN(__builtin_lsx_vaddwev_d_w, "V2LLiV4SiV4Si", "nc") +@@ -939,7 +939,7 @@ BUILTIN(__builtin_lsx_vrotri_h, "V8sV8sIi", "nc") + BUILTIN(__builtin_lsx_vrotri_w, "V4iV4iIi", "nc") + BUILTIN(__builtin_lsx_vrotri_d, "V2LLiV2LLiIi", "nc") + +-BUILTIN(__builtin_lsx_vld, "V16Scv*Ii", "nc") ++BUILTIN(__builtin_lsx_vld, "V16ScvC*Ii", "nc") + + BUILTIN(__builtin_lsx_vst, "vV16Scv*Ii", "nc") + +@@ -1641,7 +1641,7 @@ BUILTIN(__builtin_lasx_xvfrintrp_d, "V4LLiV4d", "nc") + BUILTIN(__builtin_lasx_xvfrintrm_s, "V8SiV8f", "nc") + BUILTIN(__builtin_lasx_xvfrintrm_d, "V4LLiV4d", "nc") + +-BUILTIN(__builtin_lasx_xvld, "V32Scv*Ii", "nc") ++BUILTIN(__builtin_lasx_xvld, "V32ScvC*Ii", "nc") + + BUILTIN(__builtin_lasx_xvst, "vV32Scv*Ii", "nc") + +@@ -1668,7 +1668,7 @@ BUILTIN(__builtin_lasx_xvorn_v, "V32ScV32ScV32Sc", "nc") + + BUILTIN(__builtin_lasx_xvldi, "V4LLiIi", "nc") + +-BUILTIN(__builtin_lasx_xvldx, "V32Scv*LLi", "nc") ++BUILTIN(__builtin_lasx_xvldx, "V32ScvC*LLi", "nc") + BUILTIN(__builtin_lasx_xvstx, "vV32Scv*LLi", "nc") + + BUILTIN(__builtin_lasx_xvinsgr2vr_w, "V8SiV8SiiIUi", "nc") +@@ -1701,10 +1701,10 @@ BUILTIN(__builtin_lasx_xvpermi_d, "V4LLiV4LLiIUi", "nc") + + BUILTIN(__builtin_lasx_xvperm_w, "V8iV8iV8i", "nc") + +-BUILTIN(__builtin_lasx_xvldrepl_b, "V32cv*Ii", "nc") +-BUILTIN(__builtin_lasx_xvldrepl_h, "V16sv*Ii", "nc") +-BUILTIN(__builtin_lasx_xvldrepl_w, "V8iv*Ii", "nc") +-BUILTIN(__builtin_lasx_xvldrepl_d, "V4LLiv*Ii", "nc") ++BUILTIN(__builtin_lasx_xvldrepl_b, "V32cvC*Ii", "nc") ++BUILTIN(__builtin_lasx_xvldrepl_h, "V16svC*Ii", "nc") ++BUILTIN(__builtin_lasx_xvldrepl_w, "V8ivC*Ii", "nc") ++BUILTIN(__builtin_lasx_xvldrepl_d, "V4LLivC*Ii", "nc") + + BUILTIN(__builtin_lasx_xvpickve2gr_w, "iV8SiIUi", "nc") + BUILTIN(__builtin_lasx_xvpickve2gr_d, "LLiV4SLLiIUi", "nc") +diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td +index 8850afaa6..7cd80a59d 100644 +--- a/clang/include/clang/Driver/Options.td ++++ b/clang/include/clang/Driver/Options.td +@@ -3190,12 +3190,15 @@ def mcmodel_EQ_medany : Flag<["-"], "mcmodel=medany">, Group, Group, + HelpText<"Enable use of experimental RISC-V extensions.">; + +-def munaligned_access : Flag<["-"], "munaligned-access">, Group, +- HelpText<"Allow memory accesses to be unaligned (AArch32/AArch64 only)">; +-def mno_unaligned_access : Flag<["-"], "mno-unaligned-access">, Group, +- HelpText<"Force all memory accesses to be aligned (AArch32/AArch64 only)">; ++def munaligned_access : Flag<["-"], "munaligned-access">, Group, ++ HelpText<"Allow memory accesses to be unaligned">; ++def mno_unaligned_access : Flag<["-"], "mno-unaligned-access">, Group, ++ HelpText<"Force all memory accesses to be aligned">; + def mstrict_align : Flag<["-"], "mstrict-align">, Alias, Flags<[CC1Option,HelpHidden]>, + HelpText<"Force all memory accesses to be aligned (same as mno-unaligned-access)">; ++def mno_strict_align : Flag<["-"], "mno-strict-align">, Group, ++ Flags<[CC1Option,HelpHidden]>, Alias, ++ HelpText<"Allow memory accesses to be unaligned (LoongArch only, same as munaligned-access)">; + def mno_thumb : Flag<["-"], "mno-thumb">, Group; + def mrestrict_it: Flag<["-"], "mrestrict-it">, Group, + HelpText<"Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.">; +diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp +index c402bba45..4ff4953b0 100644 +--- a/clang/lib/CodeGen/TargetInfo.cpp ++++ b/clang/lib/CodeGen/TargetInfo.cpp +@@ -11130,9 +11130,22 @@ bool LoongArchABIInfo::detectFPCCEligibleStructHelper(QualType Ty, CharUnits Cur + // Unions aren't eligible unless they're empty (which is caught above). + if (RD->isUnion()) + return false; ++ const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD); ++ // If this is a C++ record, check the bases first. ++ if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) { ++ for (const CXXBaseSpecifier &B : CXXRD->bases()) { ++ const auto *BDecl = ++ cast(B.getType()->castAs()->getDecl()); ++ CharUnits BaseOff = Layout.getBaseClassOffset(BDecl); ++ bool Ret = detectFPCCEligibleStructHelper(B.getType(), CurOff + BaseOff, ++ Field1Ty, Field1Off, Field2Ty, ++ Field2Off); ++ if (!Ret) ++ return false; ++ } ++ } + int ZeroWidthBitFieldCount = 0; + for (const FieldDecl *FD : RD->fields()) { +- const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD); + uint64_t FieldOffInBits = Layout.getFieldOffset(FD->getFieldIndex()); + QualType QTy = FD->getType(); + if (FD->isBitField()) { +@@ -11375,8 +11388,6 @@ ABIArgInfo LoongArchABIInfo::classifyArgumentType(QualType Ty, bool IsFixed, + bool IsCandidate = + detectFPCCEligibleStruct(Ty, Field1Ty, Field1Off, Field2Ty, Field2Off, + NeededArgGPRs, NeededArgFPRs); +- if (Ty->isStructureOrClassType() && isAggregateTypeForABI(Ty)) +- IsCandidate = false; + if (IsCandidate && NeededArgGPRs <= ArgGPRsLeft && + NeededArgFPRs <= ArgFPRsLeft) { + ArgGPRsLeft -= NeededArgGPRs; +@@ -11404,7 +11415,6 @@ ABIArgInfo LoongArchABIInfo::classifyArgumentType(QualType Ty, bool IsFixed, + } + + uint64_t NeededAlign = getContext().getTypeAlign(Ty); +- bool MustUseStack = false; + // Determine the number of GPRs needed to pass the current argument + // according to the ABI. 2*GRLen-aligned varargs are passed in "aligned" + // register pairs, so may consume 3 registers. +@@ -11415,7 +11425,6 @@ ABIArgInfo LoongArchABIInfo::classifyArgumentType(QualType Ty, bool IsFixed, + NeededArgGPRs = 2; + + if (NeededArgGPRs > ArgGPRsLeft) { +- MustUseStack = true; + NeededArgGPRs = ArgGPRsLeft; + } + +@@ -11428,7 +11437,7 @@ ABIArgInfo LoongArchABIInfo::classifyArgumentType(QualType Ty, bool IsFixed, + + // All integral types are promoted to GRLen width, unless passed on the + // stack. +- if (Size < GRLen && Ty->isIntegralOrEnumerationType() && !MustUseStack) { ++ if (Size < GRLen && Ty->isIntegralOrEnumerationType()) { + return extendType(Ty); + } + +diff --git a/clang/lib/Driver/ToolChains/Arch/LoongArch.cpp b/clang/lib/Driver/ToolChains/Arch/LoongArch.cpp +index 3f50d9010..f11987805 100644 +--- a/clang/lib/Driver/ToolChains/Arch/LoongArch.cpp ++++ b/clang/lib/Driver/ToolChains/Arch/LoongArch.cpp +@@ -179,6 +179,9 @@ void loongarch::getLoongArchTargetFeatures(const Driver &D, const llvm::Triple & + AddTargetFeature(Args, Features, options::OPT_mlasx, options::OPT_mno_lasx, + "lasx"); + ++ AddTargetFeature(Args, Features, options::OPT_munaligned_access, ++ options::OPT_mno_unaligned_access, "unaligned-access"); ++ + // Add the last -mfp32/-mfp64, if none are given and fp64 is default, + // pass fp64. + if (Arg *A = Args.getLastArg(options::OPT_mfp32, +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 635fd86f0..2c36bf727 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -705,6 +705,7 @@ SanitizerMask Linux::getSupportedSanitizers() const { + getTriple().getArch() == llvm::Triple::thumbeb; + const bool IsRISCV64 = getTriple().getArch() == llvm::Triple::riscv64; + const bool IsSystemZ = getTriple().getArch() == llvm::Triple::systemz; ++ const bool IsLoongArch64 = getTriple().getArch() == llvm::Triple::loongarch64; + SanitizerMask Res = ToolChain::getSupportedSanitizers(); + Res |= SanitizerKind::Address; + Res |= SanitizerKind::PointerCompare; +@@ -715,19 +716,20 @@ SanitizerMask Linux::getSupportedSanitizers() const { + Res |= SanitizerKind::Memory; + Res |= SanitizerKind::Vptr; + Res |= SanitizerKind::SafeStack; +- if (IsX86_64 || IsMIPS64 || IsAArch64) ++ if (IsX86_64 || IsMIPS64 || IsAArch64 || IsLoongArch64) + Res |= SanitizerKind::DataFlow; + if (IsX86_64 || IsMIPS64 || IsAArch64 || IsX86 || IsArmArch || IsPowerPC64 || +- IsRISCV64 || IsSystemZ) ++ IsRISCV64 || IsSystemZ || IsLoongArch64) + Res |= SanitizerKind::Leak; +- if (IsX86_64 || IsMIPS64 || IsAArch64 || IsPowerPC64 || IsSystemZ) ++ if (IsX86_64 || IsMIPS64 || IsAArch64 || IsPowerPC64 || IsSystemZ || ++ IsLoongArch64) + Res |= SanitizerKind::Thread; + if (IsX86_64) + Res |= SanitizerKind::KernelMemory; + if (IsX86 || IsX86_64) + Res |= SanitizerKind::Function; + if (IsX86_64 || IsMIPS64 || IsAArch64 || IsX86 || IsMIPS || IsArmArch || +- IsPowerPC64) ++ IsPowerPC64 || IsLoongArch64) + Res |= SanitizerKind::Scudo; + if (IsX86_64 || IsAArch64) { + Res |= SanitizerKind::HWAddress; +diff --git a/clang/lib/Headers/lasxintrin.h b/clang/lib/Headers/lasxintrin.h +index 48a0a176b..1c1484e62 100644 +--- a/clang/lib/Headers/lasxintrin.h ++++ b/clang/lib/Headers/lasxintrin.h +@@ -3776,7 +3776,7 @@ extern __inline + /* Assembly instruction format: xd, rj, si12 */ + /* Data types in instruction templates: V32QI, CVPOINTER, SI */ + #define __lasx_xvld(/*void **/ _1, /*si12*/ _2) \ +- ((__m256i)__builtin_lasx_xvld((void *)(_1), (_2))) ++ ((__m256i)__builtin_lasx_xvld((void const *)(_1), (_2))) + + /* Assembly instruction format: xd, rj, si12 */ + /* Data types in instruction templates: VOID, V32QI, CVPOINTER, SI */ +@@ -3891,8 +3891,8 @@ extern __inline + /* Data types in instruction templates: V32QI, CVPOINTER, DI */ + extern __inline + __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256i +- __lasx_xvldx(void *_1, long int _2) { +- return (__m256i)__builtin_lasx_xvldx((void *)_1, (long int)_2); ++ __lasx_xvldx(void const *_1, long int _2) { ++ return (__m256i)__builtin_lasx_xvldx((void const *)_1, (long int)_2); + } + + /* Assembly instruction format: xd, rj, rk */ +@@ -4078,22 +4078,22 @@ extern __inline + /* Assembly instruction format: xd, rj, si12 */ + /* Data types in instruction templates: V32QI, CVPOINTER, SI */ + #define __lasx_xvldrepl_b(/*void **/ _1, /*si12*/ _2) \ +- ((__m256i)__builtin_lasx_xvldrepl_b((void *)(_1), (_2))) ++ ((__m256i)__builtin_lasx_xvldrepl_b((void const *)(_1), (_2))) + + /* Assembly instruction format: xd, rj, si11 */ + /* Data types in instruction templates: V16HI, CVPOINTER, SI */ + #define __lasx_xvldrepl_h(/*void **/ _1, /*si11*/ _2) \ +- ((__m256i)__builtin_lasx_xvldrepl_h((void *)(_1), (_2))) ++ ((__m256i)__builtin_lasx_xvldrepl_h((void const *)(_1), (_2))) + + /* Assembly instruction format: xd, rj, si10 */ + /* Data types in instruction templates: V8SI, CVPOINTER, SI */ + #define __lasx_xvldrepl_w(/*void **/ _1, /*si10*/ _2) \ +- ((__m256i)__builtin_lasx_xvldrepl_w((void *)(_1), (_2))) ++ ((__m256i)__builtin_lasx_xvldrepl_w((void const *)(_1), (_2))) + + /* Assembly instruction format: xd, rj, si9 */ + /* Data types in instruction templates: V4DI, CVPOINTER, SI */ + #define __lasx_xvldrepl_d(/*void **/ _1, /*si9*/ _2) \ +- ((__m256i)__builtin_lasx_xvldrepl_d((void *)(_1), (_2))) ++ ((__m256i)__builtin_lasx_xvldrepl_d((void const *)(_1), (_2))) + + /* Assembly instruction format: rd, xj, ui3 */ + /* Data types in instruction templates: SI, V8SI, UQI */ +diff --git a/clang/lib/Headers/lsxintrin.h b/clang/lib/Headers/lsxintrin.h +index bd5f15a0a..e3c4b252a 100644 +--- a/clang/lib/Headers/lsxintrin.h ++++ b/clang/lib/Headers/lsxintrin.h +@@ -4630,22 +4630,22 @@ extern __inline + /* Assembly instruction format: vd, rj, si12 */ + /* Data types in instruction templates: V16QI, CVPOINTER, SI */ + #define __lsx_vldrepl_b(/*void **/ _1, /*si12*/ _2) \ +- ((__m128i)__builtin_lsx_vldrepl_b((void *)(_1), (_2))) ++ ((__m128i)__builtin_lsx_vldrepl_b((void const *)(_1), (_2))) + + /* Assembly instruction format: vd, rj, si11 */ + /* Data types in instruction templates: V8HI, CVPOINTER, SI */ + #define __lsx_vldrepl_h(/*void **/ _1, /*si11*/ _2) \ +- ((__m128i)__builtin_lsx_vldrepl_h((void *)(_1), (_2))) ++ ((__m128i)__builtin_lsx_vldrepl_h((void const *)(_1), (_2))) + + /* Assembly instruction format: vd, rj, si10 */ + /* Data types in instruction templates: V4SI, CVPOINTER, SI */ + #define __lsx_vldrepl_w(/*void **/ _1, /*si10*/ _2) \ +- ((__m128i)__builtin_lsx_vldrepl_w((void *)(_1), (_2))) ++ ((__m128i)__builtin_lsx_vldrepl_w((void const *)(_1), (_2))) + + /* Assembly instruction format: vd, rj, si9 */ + /* Data types in instruction templates: V2DI, CVPOINTER, SI */ + #define __lsx_vldrepl_d(/*void **/ _1, /*si9*/ _2) \ +- ((__m128i)__builtin_lsx_vldrepl_d((void *)(_1), (_2))) ++ ((__m128i)__builtin_lsx_vldrepl_d((void const *)(_1), (_2))) + + /* Assembly instruction format: vd, vj */ + /* Data types in instruction templates: V16QI, V16QI */ +@@ -4983,7 +4983,7 @@ extern __inline + /* Assembly instruction format: vd, rj, si12 */ + /* Data types in instruction templates: V16QI, CVPOINTER, SI */ + #define __lsx_vld(/*void **/ _1, /*si12*/ _2) \ +- ((__m128i)__builtin_lsx_vld((void *)(_1), (_2))) ++ ((__m128i)__builtin_lsx_vld((void const *)(_1), (_2))) + + /* Assembly instruction format: vd, rj, si12 */ + /* Data types in instruction templates: VOID, V16QI, CVPOINTER, SI */ +@@ -5062,8 +5062,8 @@ extern __inline + /* Data types in instruction templates: V16QI, CVPOINTER, DI */ + extern __inline + __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128i +- __lsx_vldx(void *_1, long int _2) { +- return (__m128i)__builtin_lsx_vldx((void *)_1, (long int)_2); ++ __lsx_vldx(void const *_1, long int _2) { ++ return (__m128i)__builtin_lsx_vldx((void const *)_1, (long int)_2); + } + + /* Assembly instruction format: vd, rj, rk */ +diff --git a/clang/test/CodeGen/LoongArch/abi-lp64d.c b/clang/test/CodeGen/LoongArch/abi-lp64d.c +new file mode 100644 +index 000000000..b6bca9161 +--- /dev/null ++++ b/clang/test/CodeGen/LoongArch/abi-lp64d.c +@@ -0,0 +1,474 @@ ++// RUN: %clang_cc1 -triple loongarch64 -target-abi lp64 \ ++ // RUN: -emit-llvm %s -o - | FileCheck %s ++ ++/// This test checks the calling convention of the lp64d ABI. ++ ++#include ++#include ++ ++/// Part 0: C Data Types and Alignment. ++ ++/// `char` datatype is signed by default. ++/// In most cases, the unsigned integer data types are zero-extended when stored ++/// in general-purpose register, and the signed integer data types are ++/// sign-extended. However, in the LP64D ABI, unsigned 32-bit types, such as ++/// unsigned int, are stored in general-purpose registers as proper sign ++/// extensions of their 32-bit values. ++ ++// CHECK-LABEL: define{{.*}} zeroext i1 @check_bool() ++_Bool check_bool() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} signext i8 @check_char() ++char check_char() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} signext i16 @check_short() ++short check_short() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} signext i32 @check_int() ++int check_int() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} i64 @check_long() ++long check_long() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} i64 @check_longlong() ++long long check_longlong() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} zeroext i8 @check_uchar() ++unsigned char check_uchar() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} zeroext i16 @check_ushort() ++unsigned short check_ushort() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} signext i32 @check_uint() ++unsigned int check_uint() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} i64 @check_ulong() ++unsigned long check_ulong() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} i64 @check_ulonglong() ++unsigned long long check_ulonglong() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} float @check_float() ++float check_float() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} double @check_double() ++double check_double() { return 0; } ++ ++// CHECK-LABEL: define{{.*}} fp128 @check_longdouble() ++long double check_longdouble() { return 0; } ++ ++/// Part 1: Scalar arguments and return value. ++ ++/// The lp64d abi says: ++/// 1. 1 < WOA <= GRLEN ++/// a. Argument is passed in a single argument register, or on the stack by ++/// value if none is available. ++/// i. If the argument is floating-point type, the argument is passed in FAR. if ++/// no FAR is available, it’s passed in GAR. If no GAR is available, it’s ++/// passed on the stack. When passed in registers or on the stack, ++/// floating-point types narrower than GRLEN bits are widened to GRLEN bits, ++/// with the upper bits undefined. ++/// ii. If the argument is integer or pointer type, the argument is passed in ++/// GAR. If no GAR is available, it’s passed on the stack. When passed in ++/// registers or on the stack, the unsigned integer scalars narrower than GRLEN ++/// bits are zero-extended to GRLEN bits, and the signed integer scalars are ++/// sign-extended. ++/// 2. GRLEN < WOA ≤ 2 × GRLEN ++/// a. The argument is passed in a pair of GAR, with the low-order GRLEN bits in ++/// the lower-numbered register and the high-order GRLEN bits in the ++/// higher-numbered register. If exactly one register is available, the ++/// low-order GRLEN bits are passed in the register and the high-order GRLEN ++/// bits are passed on the stack. If no GAR is available, it’s passed on the ++/// stack. ++ ++/// Note that most of these conventions are handled at the llvm side, so here we ++/// only check the correctness of argument (or return value)'s sign/zero ++/// extension attribute. ++ ++// CHECK-LABEL: define{{.*}} signext i32 @f_scalar(i1{{.*}} zeroext %a, i8{{.*}} signext %b, i8{{.*}} zeroext %c, i16{{.*}} signext %d, i16{{.*}} zeroext %e, i32{{.*}} signext %f, i32{{.*}} signext %g, i64{{.*}} %h, i1{{.*}} zeroext %i, i8{{.*}} signext %j, i8{{.*}} zeroext %k, i16{{.*}} signext %l, i16{{.*}} zeroext %m, i32{{.*}} signext %n, i32{{.*}} signext %o, i64{{.*}} %p) ++int f_scalar(_Bool a, int8_t b, uint8_t c, int16_t d, uint16_t e, int32_t f, ++ uint32_t g, int64_t h, /* begin of stack passing -> */ _Bool i, ++ int8_t j, uint8_t k, int16_t l, uint16_t m, int32_t n, ++ uint32_t o, int64_t p) { ++ return 0; ++} ++ ++/// Part 2: Structure arguments and return value. ++ ++/// The lp64d abi says: ++/// Empty structures are ignored by C compilers which support them as a ++/// non-standard extension(same as union arguments and return values). Bits ++/// unused due to padding, and bits past the end of a structure whose size in ++/// bits is not divisible by GRLEN, are undefined. And the layout of the ++/// structure on the stack is consistent with that in memory. ++ ++/// Check empty structs are ignored. ++ ++struct empty_s {}; ++ ++// CHECK-LABEL: define{{.*}} void @f_empty_s() ++struct empty_s f_empty_s(struct empty_s x) { ++ return x; ++} ++ ++/// 1. 0 < WOA ≤ GRLEN ++/// a. The structure has only fixed-point members. If there is an available GAR, ++/// the structure is passed through the GAR by value passing; If no GAR is ++/// available, it’s passed on the stack. ++ ++struct i16x4_s { ++ int16_t a, b, c, d; ++}; ++ ++// CHECK-LABEL: define{{.*}} i64 @f_i16x4_s(i64 %x.coerce) ++struct i16x4_s f_i16x4_s(struct i16x4_s x) { ++ return x; ++} ++ ++/// b. The structure has only floating-point members: ++/// i. One floating-point member. The argument is passed in a FAR; If no FAR is ++/// available, the value is passed in a GAR; if no GAR is available, the value ++/// is passed on the stack. ++ ++struct f32x1_s { ++ float a; ++}; ++ ++struct f64x1_s { ++ double a; ++}; ++ ++// CHECK-LABEL: define{{.*}} float @f_f32x1_s(float %0) ++struct f32x1_s f_f32x1_s(struct f32x1_s x) { ++ return x; ++} ++ ++// CHECK-LABEL: define{{.*}} double @f_f64x1_s(double %0) ++struct f64x1_s f_f64x1_s(struct f64x1_s x) { ++ return x; ++} ++ ++/// ii. Two floating-point members. The argument is passed in a pair of ++/// available FAR, with the low-order float member bits in the lower-numbered ++/// FAR and the high-order float member bits in the higher-numbered FAR. If the ++/// number of available FAR is less than 2, it’s passed in a GAR, and passed on ++/// the stack if no GAR is available. ++ ++struct f32x2_s { ++ float a, b; ++}; ++ ++// CHECK-LABEL: define{{.*}} { float, float } @f_f32x2_s(float %0, float %1) ++struct f32x2_s f_f32x2_s(struct f32x2_s x) { ++ return x; ++} ++ ++/// c. The structure has both fixed-point and floating-point members, i.e. the ++/// structure has one float member and... ++/// i. Multiple fixed-point members. If there are available GAR, the structure ++/// is passed in a GAR, and passed on the stack if no GAR is available. ++ ++struct f32x1_i16x2_s { ++ float a; ++ int16_t b, c; ++}; ++ ++// CHECK-LABEL: define{{.*}} i64 @f_f32x1_i16x2_s(i64 %x.coerce) ++struct f32x1_i16x2_s f_f32x1_i16x2_s(struct f32x1_i16x2_s x) { ++ return x; ++} ++ ++/// ii. Only one fixed-point member. If one FAR and one GAR are available, the ++/// floating-point member of the structure is passed in the FAR, and the integer ++/// member of the structure is passed in the GAR; If no floating-point register ++/// but one GAR is available, it’s passed in GAR; If no GAR is available, it’s ++/// passed on the stack. ++ ++struct f32x1_i32x1_s { ++ float a; ++ int32_t b; ++}; ++ ++// CHECK-LABEL: define{{.*}} { float, i32 } @f_f32x1_i32x1_s(float %0, i32 %1) ++struct f32x1_i32x1_s f_f32x1_i32x1_s(struct f32x1_i32x1_s x) { ++ return x; ++} ++ ++/// 2. GRLEN < WOA ≤ 2 × GRLEN ++/// a. Only fixed-point members. ++/// i. The argument is passed in a pair of available GAR, with the low-order ++/// bits in the lower-numbered GAR and the high-order bits in the ++/// higher-numbered GAR. If only one GAR is available, the low-order bits are in ++/// the GAR and the high-order bits are on the stack, and passed on the stack if ++/// no GAR is available. ++ ++struct i64x2_s { ++ int64_t a, b; ++}; ++ ++// CHECK-LABEL: define{{.*}} [2 x i64] @f_i64x2_s([2 x i64] %x.coerce) ++struct i64x2_s f_i64x2_s(struct i64x2_s x) { ++ return x; ++} ++ ++/// b. Only floating-point members. ++/// i. The structure has one long double member or one double member and two ++/// adjacent float members or 3-4 float members. The argument is passed in a ++/// pair of available GAR, with the low-order bits in the lower-numbered GAR and ++/// the high-order bits in the higher-numbered GAR. If only one GAR is ++/// available, the low-order bits are in the GAR and the high-order bits are on ++/// the stack, and passed on the stack if no GAR is available. ++ ++struct f128x1_s { ++ long double a; ++}; ++ ++// CHECK-LABEL: define{{.*}} i128 @f_f128x1_s(i128 %x.coerce) ++struct f128x1_s f_f128x1_s(struct f128x1_s x) { ++ return x; ++} ++ ++struct f64x1_f32x2_s { ++ double a; ++ float b, c; ++}; ++ ++// CHECK-LABEL: define{{.*}} [2 x i64] @f_f64x1_f32x2_s([2 x i64] %x.coerce) ++struct f64x1_f32x2_s f_f64x1_f32x2_s(struct f64x1_f32x2_s x) { ++ return x; ++} ++ ++struct f32x3_s { ++ float a, b, c; ++}; ++ ++// CHECK-LABEL: define{{.*}} [2 x i64] @f_f32x3_s([2 x i64] %x.coerce) ++struct f32x3_s f_f32x3_s(struct f32x3_s x) { ++ return x; ++} ++ ++struct f32x4_s { ++ float a, b, c, d; ++}; ++ ++// CHECK-LABEL: define{{.*}} [2 x i64] @f_f32x4_s([2 x i64] %x.coerce) ++struct f32x4_s f_f32x4_s(struct f32x4_s x) { ++ return x; ++} ++ ++/// ii. The structure with two double members is passed in a pair of available ++/// FARs. If no a pair of available FARs, it’s passed in GARs. A structure with ++/// one double member and one float member is same. ++ ++struct f64x2_s { ++ double a, b; ++}; ++ ++// CHECK-LABEL: define{{.*}} { double, double } @f_f64x2_s(double %0, double %1) ++struct f64x2_s f_f64x2_s(struct f64x2_s x) { ++ return x; ++} ++ ++/// c. Both fixed-point and floating-point members. ++/// i. The structure has one double member and only one fixed-point member. ++/// A. If one FAR and one GAR are available, the floating-point member of the ++/// structure is passed in the FAR, and the integer member of the structure is ++/// passed in the GAR; If no floating-point registers but two GARs are ++/// available, it’s passed in the two GARs; If only one GAR is available, the ++/// low-order bits are in the GAR and the high-order bits are on the stack; And ++/// it’s passed on the stack if no GAR is available. ++ ++struct f64x1_i64x1_s { ++ double a; ++ int64_t b; ++}; ++ ++// CHECK-LABEL: define{{.*}} { double, i64 } @f_f64x1_i64x1_s(double %0, i64 %1) ++struct f64x1_i64x1_s f_f64x1_i64x1_s(struct f64x1_i64x1_s x) { ++ return x; ++} ++ ++/// ii. Others ++/// A. The argument is passed in a pair of available GAR, with the low-order ++/// bits in the lower-numbered GAR and the high-order bits in the ++/// higher-numbered GAR. If only one GAR is available, the low-order bits are in ++/// the GAR and the high-order bits are on the stack, and passed on the stack if ++/// no GAR is available. ++ ++struct f64x1_i32x2_s { ++ double a; ++ int32_t b, c; ++}; ++ ++// CHECK-LABEL: define{{.*}} [2 x i64] @f_f64x1_i32x2_s([2 x i64] %x.coerce) ++struct f64x1_i32x2_s f_f64x1_i32x2_s(struct f64x1_i32x2_s x) { ++ return x; ++} ++ ++struct f32x2_i32x2_s { ++ float a, b; ++ int32_t c, d; ++}; ++ ++// CHECK-LABEL: define{{.*}} [2 x i64] @f_f32x2_i32x2_s([2 x i64] %x.coerce) ++struct f32x2_i32x2_s f_f32x2_i32x2_s(struct f32x2_i32x2_s x) { ++ return x; ++} ++ ++/// 3. WOA > 2 × GRLEN ++/// a. It’s passed by reference and are replaced in the argument list with the ++/// address. If there is an available GAR, the reference is passed in the GAR, ++/// and passed on the stack if no GAR is available. ++ ++struct i64x4_s { ++ int64_t a, b, c, d; ++}; ++ ++// CHECK-LABEL: define{{.*}} void @f_i64x4_s(%struct.i64x4_s*{{.*}} sret(%struct.i64x4_s){{.*}} %agg.result, %struct.i64x4_s*{{.*}} %x) ++struct i64x4_s f_i64x4_s(struct i64x4_s x) { ++ return x; ++} ++ ++struct f64x4_s { ++ double a, b, c, d; ++}; ++ ++// CHECK-LABEL: define{{.*}} void @f_f64x4_s(%struct.f64x4_s*{{.*}} sret(%struct.f64x4_s){{.*}} %agg.result, %struct.f64x4_s*{{.*}} %x) ++struct f64x4_s f_f64x4_s(struct f64x4_s x) { ++ return x; ++} ++ ++/// Part 3: Union arguments and return value. ++ ++/// Check empty unions are ignored. ++ ++union empty_u {}; ++ ++// CHECK-LABEL: define{{.*}} void @f_empty_u() ++union empty_u f_empty_u(union empty_u x) { ++ return x; ++} ++ ++/// Union is passed in GAR or stack. ++/// 1. 0 < WOA ≤ GRLEN ++/// a. The argument is passed in a GAR, or on the stack by value if no GAR is ++/// available. ++ ++union i32_f32_u { ++ int32_t a; ++ float b; ++}; ++ ++// CHECK-LABEL: define{{.*}} i64 @f_i32_f32_u(i64 %x.coerce) ++union i32_f32_u f_i32_f32_u(union i32_f32_u x) { ++ return x; ++} ++ ++union i64_f64_u { ++ int64_t a; ++ double b; ++}; ++ ++// CHECK-LABEL: define{{.*}} i64 @f_i64_f64_u(i64 %x.coerce) ++union i64_f64_u f_i64_f64_u(union i64_f64_u x) { ++ return x; ++} ++ ++/// 2. GRLEN < WOA ≤ 2 × GRLEN ++/// a. The argument is passed in a pair of available GAR, with the low-order ++/// bits in the lower-numbered GAR and the high-order bits in the ++/// higher-numbered GAR. If only one GAR is available, the low-order bits are in ++/// the GAR and the high-order bits are on the stack. The arguments are passed ++/// on the stack when no GAR is available. ++ ++union i128_f128_u { ++ __int128_t a; ++ long double b; ++}; ++ ++// CHECK-LABEL: define{{.*}} i128 @f_i128_f128_u(i128 %x.coerce) ++union i128_f128_u f_i128_f128_u(union i128_f128_u x) { ++ return x; ++} ++ ++/// 3. WOA > 2 × GRLEN ++/// a. It’s passed by reference and are replaced in the argument list with the ++/// address. If there is an available GAR, the reference is passed in the GAR, ++/// and passed on the stack if no GAR is available. ++ ++union i64_arr3_u { ++ int64_t a[3]; ++}; ++ ++// CHECK-LABEL: define{{.*}} void @f_i64_arr3_u(%union.i64_arr3_u*{{.*}} sret(%union.i64_arr3_u){{.*}} %agg.result, %union.i64_arr3_u*{{.*}} %x) ++union i64_arr3_u f_i64_arr3_u(union i64_arr3_u x) { ++ return x; ++} ++ ++/// Part 4: Complex number arguments and return value. ++ ++/// A complex floating-point number, or a structure containing just one complex ++/// floating-point number, is passed as though it were a structure containing ++/// two floating-point reals. ++ ++// CHECK-LABEL: define{{.*}} { float, float } @f_floatcomplex(float{{.*}} %x.coerce0, float{{.*}} %x.coerce1) ++float __complex__ f_floatcomplex(float __complex__ x) { return x; } ++ ++// CHECK-LABEL: define{{.*}} { double, double } @f_doublecomplex(double{{.*}} %x.coerce0, double{{.*}} %x.coerce1) ++double __complex__ f_doublecomplex(double __complex__ x) { return x; } ++ ++struct floatcomplex_s { ++ float __complex__ c; ++}; ++// CHECK-LABEL: define{{.*}} { float, float } @f_floatcomplex_s(float %0, float %1) ++struct floatcomplex_s f_floatcomplex_s(struct floatcomplex_s x) { ++ return x; ++} ++ ++struct doublecomplex_s { ++ double __complex__ c; ++}; ++// CHECK-LABEL: define{{.*}} { double, double } @f_doublecomplex_s(double %0, double %1) ++struct doublecomplex_s f_doublecomplex_s(struct doublecomplex_s x) { ++ return x; ++} ++ ++/// Part 5: Variadic arguments. ++ ++/// Variadic arguments are passed in GARs in the same manner as named arguments. ++ ++int f_va_callee(int, ...); ++ ++// CHECK-LABEL: define{{.*}} void @f_va_caller() ++// CHECK: call signext i32 (i32, ...) @f_va_callee(i32{{.*}} signext 1, i32{{.*}} signext 2, i64{{.*}} 3, double{{.*}} 4.000000e+00, double{{.*}} 5.000000e+00, i64 {{.*}}, i64 {{.*}}, i64 {{.*}}) ++void f_va_caller(void) { ++ f_va_callee(1, 2, 3LL, 4.0f, 5.0, (struct i16x4_s){6, 7, 8, 9}, ++ (struct i64x2_s){10, 11}); ++} ++ ++// CHECK-LABE: define signext i32 @f_va_int(i8* %fmt, ...) ++// CHECK: entry: ++// CHECK: %fmt.addr = alloca i8*, align 8 ++// CHECK: %va = alloca i8*, align 8 ++// CHECK: %v = alloca i32, align 4 ++// CHECK: store i8* %fmt, i8** %fmt.addr, align 8 ++// CHECK: %va1 = bitcast i8** %va to i8* ++// CHECK: call void @llvm.va_start(i8* %va1) ++// CHECK: %argp.cur = load i8*, i8** %va, align 8 ++// CHECK: %argp.next = getelementptr inbounds i8, i8* %argp.cur, i64 8 ++// CHECK: store i8* %argp.next, i8** %va, align 8 ++// CHECK: %0 = bitcast i8* %argp.cur to i32* ++// CHECK: %1 = load i32, i32* %0, align 8 ++// CHECK: store i32 %1, i32* %v, align 4 ++// CHECK: %va2 = bitcast i8** %va to i8* ++// CHECK: call void @llvm.va_end(i8* %va2) ++// CHECK: %2 = load i32, i32* %v, align 4 ++// CHECK: ret i32 %2 ++// CHECK: } ++int f_va_int(char *fmt, ...) { ++ __builtin_va_list va; ++ __builtin_va_start(va, fmt); ++ int v = __builtin_va_arg(va, int); ++ __builtin_va_end(va); ++ return v; ++} +diff --git a/clang/test/CodeGen/LoongArch/inlineasm-float-double-in-gpr.c b/clang/test/CodeGen/LoongArch/inlineasm-float-double-in-gpr.c +new file mode 100644 +index 000000000..bc9c616bb +--- /dev/null ++++ b/clang/test/CodeGen/LoongArch/inlineasm-float-double-in-gpr.c +@@ -0,0 +1,49 @@ ++// RUN: %clang_cc1 -triple loongarch64 -O2 -emit-llvm %s -o - \ ++// RUN: | FileCheck %s ++ ++float f; ++double d; ++ ++// CHECK-LABEL: @reg_float( ++// CHECK: [[FLT_ARG:%.*]] = load float, float* @f ++// CHECK: call void asm sideeffect "", "r"(float [[FLT_ARG]]) ++// CHECK: ret void ++void reg_float() { ++ float a = f; ++ asm volatile("" ++ : ++ : "r"(a)); ++} ++ ++// CHECK-LABEL: @r4_float( ++// CHECK: [[FLT_ARG:%.*]] = load float, float* @f ++// CHECK: call void asm sideeffect "", "{$r4}"(float [[FLT_ARG]]) ++// CHECK: ret void ++void r4_float() { ++ register float a asm("$r4") = f; ++ asm volatile("" ++ : ++ : "r"(a)); ++} ++ ++// CHECK-LABEL: @reg_double( ++// CHECK: [[DBL_ARG:%.*]] = load double, double* @d ++// CHECK: call void asm sideeffect "", "r"(double [[DBL_ARG]]) ++// CHECK: ret void ++void reg_double() { ++ double a = d; ++ asm volatile("" ++ : ++ : "r"(a)); ++} ++ ++// CHECK-LABEL: @r4_double( ++// CHECK: [[DBL_ARG:%.*]] = load double, double* @d ++// CHECK: call void asm sideeffect "", "{$r4}"(double [[DBL_ARG]]) ++// CHECK: ret void ++void r4_double() { ++ register double a asm("$r4") = d; ++ asm volatile("" ++ : ++ : "r"(a)); ++} +diff --git a/clang/test/CodeGen/sanitize-coverage-old-pm.c b/clang/test/CodeGen/sanitize-coverage-old-pm.c +index 18123a53b..6711d4bda 100644 +--- a/clang/test/CodeGen/sanitize-coverage-old-pm.c ++++ b/clang/test/CodeGen/sanitize-coverage-old-pm.c +@@ -6,9 +6,9 @@ + // RUN: %clang %s -target x86_64-unknown-linux-gnu -emit-llvm -S -fsanitize=undefined -fsanitize-coverage=trace-pc,trace-cmp -o - -flegacy-pass-manager | FileCheck %s --check-prefixes=CHECK,UBSAN + // + // Host armv7 is currently unsupported: https://bugs.llvm.org/show_bug.cgi?id=46117 +-// UNSUPPORTED: armv7, armv7l, thumbv7, armv8l +-// The same issue also occurs on riscv32 and loongarch64 hosts. +-// XFAIL: riscv32, loongarch64 ++// UNSUPPORTED: armv7, armv7l, thumbv7, armv8l, loongarch64 ++// The same issue also occurs on a riscv32 host. ++// XFAIL: riscv32 + + int x[10]; + +diff --git a/clang/test/CodeGen/struct-128.cpp b/clang/test/CodeGen/struct-128.cpp +deleted file mode 100644 +index c15fa0ff3..000000000 +--- a/clang/test/CodeGen/struct-128.cpp ++++ /dev/null +@@ -1,23 +0,0 @@ +-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +-// RUN: %clang_cc1 -O1 -triple loongarch64-linux-gnu -emit-llvm %s -o - | FileCheck %s +- +-//Check that a struct return value with a certain condition on loongarch64 is returned by address +- +-typedef struct _B { +- int *ptr; +- int index; +-} B; +- +-typedef struct _A : B { +- float dd; +-} A; +- +-// CHECK-LABEL: void @_Z3foov(%struct._A* +-// CHECK-NEXT: entry: +-// CHECK-NEXT: ret void +-// +-A foo() +-{ +- A a; +- return a; +-} +diff --git a/clang/test/CodeGen/struct-packed-128.cpp b/clang/test/CodeGen/struct-packed-128.cpp +deleted file mode 100644 +index d31ccb08d..000000000 +--- a/clang/test/CodeGen/struct-packed-128.cpp ++++ /dev/null +@@ -1,23 +0,0 @@ +-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +-// RUN: %clang_cc1 -triple loongarch64-linux-gnu -emit-llvm %s -o - | FileCheck %s +-typedef struct _B { +- int *ptr; +- int index; +-} __attribute__((packed)) B; +- +-typedef struct _A : B { +- float dd; +-} A; +- +-// CHECK-LABEL: [2 x i64] @_Z3foov( +-// CHECK-NEXT: entry: +-// CHECK-NEXT: [[RETVAL:%.*]] = alloca [[STRUCT__A:%.*]], align 4 +-// CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct._A* [[RETVAL]] to [2 x i64]* +-// CHECK-NEXT: [[TMP1:%.*]] = load [2 x i64], [2 x i64]* [[TMP0]], align 4 +-// CHECK-NEXT: ret [2 x i64] [[TMP1]] +-// +-A foo() +-{ +- A a; +- return a; +-} +diff --git a/clang/test/CodeGen/struct-private-128.cpp b/clang/test/CodeGen/struct-private-128.cpp +deleted file mode 100644 +index 336fd817a..000000000 +--- a/clang/test/CodeGen/struct-private-128.cpp ++++ /dev/null +@@ -1,24 +0,0 @@ +-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +-// RUN: %clang_cc1 -triple loongarch64-linux-gnu -emit-llvm %s -o - | FileCheck %s +-typedef struct _B { +- int *ptr; +-private: +- int index; +-} B; +- +-typedef struct _A : B { +- float dd; +-} A; +- +-// CHECK-LABEL: @_Z3foov( +-// CHECK-NEXT: entry: +-// CHECK-NEXT: [[RETVAL:%.*]] = alloca [[STRUCT__A:%.*]], align 8 +-// CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct._A* [[RETVAL]] to [2 x i64]* +-// CHECK-NEXT: [[TMP1:%.*]] = load [2 x i64], [2 x i64]* [[TMP0]], align 8 +-// CHECK-NEXT: ret [2 x i64] [[TMP1]] +-// +-A foo() +-{ +- A a; +- return a; +-} +diff --git a/clang/test/CodeGen/struct-static.cpp b/clang/test/CodeGen/struct-static.cpp +deleted file mode 100644 +index 4253a80d0..000000000 +--- a/clang/test/CodeGen/struct-static.cpp ++++ /dev/null +@@ -1,25 +0,0 @@ +-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +-// RUN: %clang_cc1 -triple loongarch64-linux-gnu -emit-llvm %s -o - | FileCheck %s +- +-typedef struct _B { +- static long ptr; +- int index; +-} B; +- +-typedef struct _A : B { +- float dd; +-} A; +- +-// CHECK-LABEL: @_Z3foov( +-// CHECK-NEXT: entry: +-// CHECK-NEXT: [[RETVAL:%.*]] = alloca [[STRUCT__A:%.*]], align 4 +-// CHECK-NEXT: [[TMP0:%.*]] = bitcast %struct._A* [[RETVAL]] to i64* +-// CHECK-NEXT: [[TMP1:%.*]] = load i64, i64* [[TMP0]], align 4 +-// CHECK-NEXT: ret i64 [[TMP1]] +-// +-A foo() +-{ +- A a; +- return a; +-} +- +diff --git a/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c b/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c +index 324896942..1223cd9a5 100644 +--- a/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c ++++ b/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c +@@ -3,11 +3,11 @@ + // REQUIRES: x86-registered-target + + // RUN: llvm-profdata merge -o %t1.profdata %S/Inputs/thinlto_expect1.proftext +-// RUN: %clang -O2 -fexperimental-new-pass-manager -flto=thin -g -fprofile-use=%t1.profdata -c -o %t1.bo %s ++// RUN: %clang -target x86_64-linux-gnu -O2 -fexperimental-new-pass-manager -flto=thin -g -fprofile-use=%t1.profdata -c -o %t1.bo %s + // RUN: llvm-lto -thinlto -o %t %t1.bo +-// RUN: %clang -cc1 -O2 -fexperimental-new-pass-manager -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -emit-obj -Rpass-analysis=info 2>&1 | FileCheck %s -check-prefix=CHECK-REMARK ++// RUN: %clang -cc1 -triple x86_64-linux-gnu -O2 -fexperimental-new-pass-manager -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -emit-obj -Rpass-analysis=info 2>&1 | FileCheck %s -check-prefix=CHECK-REMARK + // RUN: llvm-profdata merge -o %t2.profdata %S/Inputs/thinlto_expect2.proftext +-// RUN: %clang -cc1 -O2 -fexperimental-new-pass-manager -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -fprofile-instrument-use-path=%t2.profdata -emit-obj 2>&1 | FileCheck %s -allow-empty -check-prefix=CHECK-NOWARNING ++// RUN: %clang -cc1 -triple x86_64-linux-gnu -O2 -fexperimental-new-pass-manager -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -fprofile-instrument-use-path=%t2.profdata -emit-obj 2>&1 | FileCheck %s -allow-empty -check-prefix=CHECK-NOWARNING + + int sum; + __attribute__((noinline)) void bar() { +diff --git a/clang/test/CodeGenCXX/LoongArch/abi-lp64d-struct-inherit.cpp b/clang/test/CodeGenCXX/LoongArch/abi-lp64d-struct-inherit.cpp +new file mode 100644 +index 000000000..34fcc57ba +--- /dev/null ++++ b/clang/test/CodeGenCXX/LoongArch/abi-lp64d-struct-inherit.cpp +@@ -0,0 +1,95 @@ ++// RUN: %clang_cc1 -triple loongarch64 -target-abi lp64 \ ++// RUN: -emit-llvm %s -o - | FileCheck %s ++ ++#include ++ ++/// Ensure that fields inherited from a parent struct are treated in the same ++/// way as fields directly in the child for the purposes of LoongArch ABI rules. ++ ++struct parent1_int32_s { ++ int32_t i1; ++}; ++ ++struct child1_int32_s : parent1_int32_s { ++ int32_t i2; ++}; ++ ++// CHECK-LABEL: define{{.*}} i64 @_Z30int32_int32_struct_inheritance14child1_int32_s(i64 %a.coerce) ++struct child1_int32_s int32_int32_struct_inheritance(struct child1_int32_s a) { ++ return a; ++} ++ ++struct parent2_int32_s { ++ int32_t i1; ++}; ++ ++struct child2_float_s : parent2_int32_s { ++ float f1; ++}; ++ ++// CHECK-LABEL: define{{.*}} { i32, float } @_Z30int32_float_struct_inheritance14child2_float_s(i32 %0, float %1) ++struct child2_float_s int32_float_struct_inheritance(struct child2_float_s a) { ++ return a; ++} ++ ++struct parent3_float_s { ++ float f1; ++}; ++ ++struct child3_int64_s : parent3_float_s { ++ int64_t i1; ++}; ++ ++// CHECK-LABEL: define{{.*}} { float, i64 } @_Z30float_int64_struct_inheritance14child3_int64_s(float %0, i64 %1) ++struct child3_int64_s float_int64_struct_inheritance(struct child3_int64_s a) { ++ return a; ++} ++ ++struct parent4_double_s { ++ double d1; ++}; ++ ++struct child4_double_s : parent4_double_s { ++ double d1; ++}; ++ ++// CHECK-LABEL: define{{.*}} { double, double } @_Z32double_double_struct_inheritance15child4_double_s(double %0, double %1) ++struct child4_double_s double_double_struct_inheritance(struct child4_double_s a) { ++ return a; ++} ++ ++/// When virtual inheritance is used, the resulting struct isn't eligible for ++/// passing in registers. ++ ++struct parent5_virtual_s { ++ int32_t i1; ++}; ++ ++struct child5_virtual_s : virtual parent5_virtual_s { ++ float f1; ++}; ++ ++// CHECK-LABEL: define{{.*}} void @_ZN16child5_virtual_sC1EOS_(%struct.child5_virtual_s*{{.*}} %this, %struct.child5_virtual_s*{{.*}} dereferenceable(12) %0) ++struct child5_virtual_s int32_float_virtual_struct_inheritance(struct child5_virtual_s a) { ++ return a; ++} ++ ++/// Check for correct lowering in the presence of diamoned inheritance. ++ ++struct parent6_float_s { ++ float f1; ++}; ++ ++struct child6a_s : parent6_float_s { ++}; ++ ++struct child6b_s : parent6_float_s { ++}; ++ ++struct grandchild_6_s : child6a_s, child6b_s { ++}; ++ ++// CHECK-LABEL: define{{.*}} { float, float } @_Z38float_float_diamond_struct_inheritance14grandchild_6_s(float %0, float %1) ++struct grandchild_6_s float_float_diamond_struct_inheritance(struct grandchild_6_s a) { ++ return a; ++} +diff --git a/clang/test/Driver/loongarch-alignment-feature.c b/clang/test/Driver/loongarch-alignment-feature.c +new file mode 100644 +index 000000000..2270ff536 +--- /dev/null ++++ b/clang/test/Driver/loongarch-alignment-feature.c +@@ -0,0 +1,8 @@ ++// RUN: %clang -target loongarch64-unknown-linux-gnu -mno-strict-align -### %s 2> %t ++// RUN: FileCheck --check-prefix=CHECK-UNALIGNED < %t %s ++ ++// RUN: %clang -target loongarch64-unknown-linux-gnu -mstrict-align -### %s 2> %t ++// RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s ++ ++// CHECK-UNALIGNED: "-target-feature" "+unaligned-access" ++// CHECK-ALIGNED: "-target-feature" "-unaligned-access" +diff --git a/clang/test/Driver/mips-abi.c b/clang/test/Driver/mips-abi.c +index b51bb74c2..f0f678b42 100644 +--- a/clang/test/Driver/mips-abi.c ++++ b/clang/test/Driver/mips-abi.c +@@ -12,7 +12,7 @@ + // FIXME: This is a valid combination of options but we reject it at the moment + // because the backend can't handle it. + // RUN: not %clang -target mips-linux-gnu -c %s \ +-// RUN: -march=mips64r2 -mabi=o32 2>&1 \ ++// RUN: -march=mips64r2 -mabi=32 2>&1 \ + // RUN: | FileCheck -check-prefix=MIPS64R2-O32 %s + // MIPS64R2-O32: error: ABI 'o32' is not supported on CPU 'mips64r2' + // +@@ -125,7 +125,7 @@ + // MIPS-ARCH-P5600: "-target-abi" "o32" + // + // RUN: not %clang -target mips-linux-gnu -c %s \ +-// RUN: -march=p5600 -mabi=n64 2>&1 \ ++// RUN: -march=p5600 -mabi=64 2>&1 \ + // RUN: | FileCheck -check-prefix=MIPS-ARCH-P5600-N64 %s + // MIPS-ARCH-P5600-N64: error: ABI 'n64' is not supported on CPU 'p5600' + // +diff --git a/clang/test/Driver/mips-cs.cpp b/clang/test/Driver/mips-cs.cpp +index bf0f12afd..6ef4c5d43 100644 +--- a/clang/test/Driver/mips-cs.cpp ++++ b/clang/test/Driver/mips-cs.cpp +@@ -4,8 +4,7 @@ + // + // = Big-endian, hard float + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-32 %s + // CHECK-BE-HF-32: "-internal-isystem" +@@ -33,8 +32,7 @@ + // + // = Big-endian, hard float, uclibc + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -muclibc -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-UC-HF-32 %s + // CHECK-BE-UC-HF-32: "-internal-isystem" +@@ -63,8 +61,7 @@ + // + // = Big-endian, hard float, mips16 + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -mips16 -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -mips16 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-16 %s + // CHECK-BE-HF-16: "-internal-isystem" +@@ -93,8 +90,7 @@ + // + // = Big-endian, hard float, mmicromips + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -mmicromips -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -mmicromips \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-MICRO %s + // CHECK-BE-HF-MICRO: "-internal-isystem" +@@ -123,8 +119,7 @@ + // + // = Big-endian, hard float, nan2008 + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -mnan=2008 -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-NAN %s + // CHECK-BE-HF-NAN: "-internal-isystem" +@@ -153,8 +148,7 @@ + // + // = Big-endian, hard float, uclibc, nan2008 + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -muclibc -mnan=2008 -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -muclibc -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-UC-HF-NAN %s + // CHECK-BE-UC-HF-NAN: "-internal-isystem" +@@ -183,8 +177,7 @@ + // + // = Big-endian, soft float + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -msoft-float -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-32 %s + // CHECK-BE-SF-32: "-internal-isystem" +@@ -213,8 +206,7 @@ + // + // = Big-endian, soft float, uclibc + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -muclibc -msoft-float -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -muclibc -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-UC-SF-32 %s + // CHECK-BE-UC-SF-32: "-internal-isystem" +@@ -243,8 +235,7 @@ + // + // = Big-endian, soft float, mips16 + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -msoft-float -mips16 -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -msoft-float -mips16 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-16 %s + // CHECK-BE-SF-16: "-internal-isystem" +@@ -273,8 +264,7 @@ + // + // = Big-endian, soft float, micromips + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips-linux-gnu -msoft-float -mmicromips -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips-linux-gnu -msoft-float -mmicromips \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-MICRO %s + // CHECK-BE-SF-MICRO: "-internal-isystem" +@@ -303,8 +293,7 @@ + // + // = Big-endian, hard float, 64-bit + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64-linux-gnu -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips64-linux-gnu \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-64 %s + // CHECK-BE-HF-64: "-internal-isystem" +@@ -333,8 +322,7 @@ + // + // = Big-endian, soft float, 64-bit + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64-linux-gnu -msoft-float -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips64-linux-gnu -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-64 %s + // CHECK-BE-SF-64: "-internal-isystem" +@@ -363,8 +351,7 @@ + // + // = Little-endian, hard float + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mhard-float -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-32 %s + // CHECK-EL-HF-32: "-internal-isystem" +@@ -393,8 +380,7 @@ + // + // = Little-endian, hard float, uclibc + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mhard-float -muclibc -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -mhard-float -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-UC-HF-32 %s + // CHECK-EL-UC-HF-32: "-internal-isystem" +@@ -423,8 +409,7 @@ + // + // = Little-endian, hard float, mips16 + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mips16 -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -mips16 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-16 %s + // CHECK-EL-HF-16: "-internal-isystem" +@@ -453,8 +438,7 @@ + // + // = Little-endian, hard float, micromips + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mmicromips -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -mmicromips \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-MICRO %s + // CHECK-EL-HF-MICRO: "-internal-isystem" +@@ -483,8 +467,7 @@ + // + // = Little-endian, hard float, nan2008 + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mnan=2008 -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-NAN %s + // CHECK-EL-HF-NAN: "-internal-isystem" +@@ -513,8 +496,7 @@ + // + // = Little-endian, hard float, uclibc, nan2008 + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -muclibc -mnan=2008 -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -muclibc -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-UC-HF-NAN %s + // CHECK-EL-UC-HF-NAN: "-internal-isystem" +@@ -543,9 +525,7 @@ + // + // = Little-endian, soft float + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft -no-pie \ + // RUN: --target=mipsel-linux-gnu -mfloat-abi=soft \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-32 %s + // CHECK-EL-SF-32: "-internal-isystem" +@@ -574,8 +554,7 @@ + // + // = Little-endian, soft float, uclibc + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft -muclibc -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -mfloat-abi=soft -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-UC-SF-32 %s + // CHECK-EL-UC-SF-32: "-internal-isystem" +@@ -604,8 +583,7 @@ + // + // = Little-endian, soft float, mips16 + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mips16 -msoft-float -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -mips16 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-16 %s + // CHECK-EL-SF-16: "-internal-isystem" +@@ -634,8 +612,7 @@ + // + // = Little-endian, soft float, micromips + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mipsel-linux-gnu -mmicromips -msoft-float -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mipsel-linux-gnu -mmicromips -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-MICRO %s + // CHECK-EL-SF-MICRO: "-internal-isystem" +@@ -664,8 +641,7 @@ + // + // = Little-endian, hard float, 64-bit + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-gnu -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips64el-linux-gnu \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-64 %s + // CHECK-EL-HF-64: "-internal-isystem" +@@ -694,8 +670,7 @@ + // + // = Little-endian, soft float, 64-bit + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +-// RUN: --target=mips64el-linux-gnu -msoft-float -no-pie \ +-// RUN: --sysroot="" \ ++// RUN: --target=mips64el-linux-gnu -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_cs_tree \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-64 %s + // CHECK-EL-SF-64: "-internal-isystem" +diff --git a/clang/test/Driver/mips-fsf.cpp b/clang/test/Driver/mips-fsf.cpp +index 35bc8aef5..b94da6978 100644 +--- a/clang/test/Driver/mips-fsf.cpp ++++ b/clang/test/Driver/mips-fsf.cpp +@@ -6,7 +6,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-32 %s + // CHECK-BE-HF-32: "-internal-isystem" + // CHECK-BE-HF-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -34,7 +33,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-32 %s + // CHECK-BE-HF64-32: "-internal-isystem" + // CHECK-BE-HF64-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -62,7 +60,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-32 %s + // CHECK-BE-SF-32: "-internal-isystem" + // CHECK-BE-SF-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -90,7 +87,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mips16 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-16 %s + // CHECK-BE-HF-16: "-internal-isystem" + // CHECK-BE-HF-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -118,7 +114,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mips16 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-16 %s + // CHECK-BE-HF64-16: "-internal-isystem" + // CHECK-BE-HF64-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -146,7 +141,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mips16 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-16 %s + // CHECK-BE-SF-16: "-internal-isystem" + // CHECK-BE-SF-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -174,7 +168,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mips16 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-16 %s + // CHECK-BE-NAN-16: "-internal-isystem" + // CHECK-BE-NAN-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -202,7 +195,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mips16 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-16 %s + // CHECK-BE-NAN64-16: "-internal-isystem" + // CHECK-BE-NAN64-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -230,7 +222,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-32 %s + // CHECK-BE-NAN-32: "-internal-isystem" + // CHECK-BE-NAN-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -258,7 +249,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-32 %s + // CHECK-BE-NAN64-32: "-internal-isystem" + // CHECK-BE-NAN64-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -286,7 +276,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R2 %s + // CHECK-BE-HF-32R2: "-internal-isystem" + // CHECK-BE-HF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -314,7 +303,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mhard-float -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-UC-HF-32R2 %s + // CHECK-BE-UC-HF-32R2: "-internal-isystem" + // CHECK-BE-UC-HF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -342,7 +330,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-32R2 %s + // CHECK-BE-HF64-32R2: "-internal-isystem" + // CHECK-BE-HF64-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -370,7 +357,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-32R2 %s + // CHECK-BE-SF-32R2: "-internal-isystem" + // CHECK-BE-SF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -398,7 +384,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -msoft-float -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-UC-SF-32R2 %s + // CHECK-BE-UC-SF-32R2: "-internal-isystem" + // CHECK-BE-UC-SF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -426,7 +411,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mips16 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-16R2 %s + // CHECK-BE-HF-16R2: "-internal-isystem" + // CHECK-BE-HF-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -454,7 +438,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mips16 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-16R2 %s + // CHECK-BE-HF64-16R2: "-internal-isystem" + // CHECK-BE-HF64-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -482,7 +465,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mips16 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-16R2 %s + // CHECK-BE-SF-16R2: "-internal-isystem" + // CHECK-BE-SF-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -510,7 +492,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mips16 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-16R2 %s + // CHECK-BE-NAN-16R2: "-internal-isystem" + // CHECK-BE-NAN-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -538,7 +519,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mips16 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-16R2 %s + // CHECK-BE-NAN64-16R2: "-internal-isystem" + // CHECK-BE-NAN64-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -566,7 +546,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-32R2 %s + // CHECK-BE-NAN-32R2: "-internal-isystem" + // CHECK-BE-NAN-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -594,7 +573,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mnan=2008 -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-UC-NAN-32R2 %s + // CHECK-BE-UC-NAN-32R2: "-internal-isystem" + // CHECK-BE-UC-NAN-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -622,7 +600,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r2 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-32R2 %s + // CHECK-BE-NAN64-32R2: "-internal-isystem" + // CHECK-BE-NAN64-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -650,7 +627,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-32R2-DEF %s + // CHECK-BE-NAN64-32R2-DEF: "-internal-isystem" + // CHECK-BE-NAN64-32R2-DEF: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -678,7 +654,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mmicromips -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-MM %s + // CHECK-BE-HF-MM: "-internal-isystem" + // CHECK-BE-HF-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -706,7 +681,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mmicromips -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-MM %s + // CHECK-BE-HF64-MM: "-internal-isystem" + // CHECK-BE-HF64-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -734,7 +708,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mmicromips -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-MM %s + // CHECK-BE-SF-MM: "-internal-isystem" + // CHECK-BE-SF-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -762,7 +735,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mmicromips -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-MM %s + // CHECK-BE-NAN-MM: "-internal-isystem" + // CHECK-BE-NAN-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -790,7 +762,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mmicromips -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-MM %s + // CHECK-BE-NAN64-MM: "-internal-isystem" + // CHECK-BE-NAN64-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -818,7 +789,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=n32 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-64-N32 %s + // CHECK-BE-HF-64-N32: "-internal-isystem" + // CHECK-BE-HF-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -846,7 +816,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=n32 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-64-N32 %s + // CHECK-BE-HF64-64-N32: "-internal-isystem" + // CHECK-BE-HF64-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -874,7 +843,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=n32 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-64-N32 %s + // CHECK-BE-SF-64-N32: "-internal-isystem" + // CHECK-BE-SF-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -902,7 +870,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=n32 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-64-N32 %s + // CHECK-BE-NAN-64-N32: "-internal-isystem" + // CHECK-BE-NAN-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -930,7 +897,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=n32 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64-N32 %s + // CHECK-BE-NAN64-64-N32: "-internal-isystem" + // CHECK-BE-NAN64-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -958,7 +924,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-64-64 %s + // CHECK-BE-HF-64-64: "-internal-isystem" + // CHECK-BE-HF-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -986,7 +951,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=64 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-64-64 %s + // CHECK-BE-HF64-64-64: "-internal-isystem" + // CHECK-BE-HF64-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1014,7 +978,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=64 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-64-64 %s + // CHECK-BE-SF-64-64: "-internal-isystem" + // CHECK-BE-SF-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1042,7 +1005,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-64-64 %s + // CHECK-BE-NAN-64-64: "-internal-isystem" + // CHECK-BE-NAN-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1070,7 +1032,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64 -mabi=64 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64-64 %s + // CHECK-BE-NAN64-64-64: "-internal-isystem" + // CHECK-BE-NAN64-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1098,7 +1059,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=n32 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-64R2-N32 %s + // CHECK-BE-HF-64R2-N32: "-internal-isystem" + // CHECK-BE-HF-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1126,7 +1086,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=n32 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-64R2-N32 %s + // CHECK-BE-HF64-64R2-N32: "-internal-isystem" + // CHECK-BE-HF64-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1154,7 +1113,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=n32 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-64R2-N32 %s + // CHECK-BE-SF-64R2-N32: "-internal-isystem" + // CHECK-BE-SF-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1182,7 +1140,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=n32 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-64R2-N32 %s + // CHECK-BE-NAN-64R2-N32: "-internal-isystem" + // CHECK-BE-NAN-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1210,7 +1167,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=n32 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64R2-N32 %s + // CHECK-BE-NAN64-64R2-N32: "-internal-isystem" + // CHECK-BE-NAN64-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1238,7 +1194,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-64R2-64 %s + // CHECK-BE-HF-64R2-64: "-internal-isystem" + // CHECK-BE-HF-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1266,7 +1221,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=64 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF64-64R2-64 %s + // CHECK-BE-HF64-64R2-64: "-internal-isystem" + // CHECK-BE-HF64-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1294,7 +1248,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=64 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-SF-64R2-64 %s + // CHECK-BE-SF-64R2-64: "-internal-isystem" + // CHECK-BE-SF-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1322,7 +1275,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN-64R2-64 %s + // CHECK-BE-NAN-64R2-64: "-internal-isystem" + // CHECK-BE-NAN-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1350,7 +1302,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r2 -mabi=64 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64R2-64 %s + // CHECK-BE-NAN64-64R2-64: "-internal-isystem" + // CHECK-BE-NAN64-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1378,7 +1329,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mabi=64 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-NAN64-64R2-64-DEF %s + // CHECK-BE-NAN64-64R2-64-DEF: "-internal-isystem" + // CHECK-BE-NAN64-64R2-64-DEF: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1406,7 +1356,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-32 %s + // CHECK-EL-HF-32: "-internal-isystem" + // CHECK-EL-HF-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1434,7 +1383,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-32 %s + // CHECK-EL-HF64-32: "-internal-isystem" + // CHECK-EL-HF64-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1462,7 +1410,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-32 %s + // CHECK-EL-SF-32: "-internal-isystem" + // CHECK-EL-SF-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1490,7 +1437,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mips16 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-16 %s + // CHECK-EL-HF-16: "-internal-isystem" + // CHECK-EL-HF-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1518,7 +1464,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mips16 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-16 %s + // CHECK-EL-HF64-16: "-internal-isystem" + // CHECK-EL-HF64-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1546,7 +1491,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mips16 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-16 %s + // CHECK-EL-SF-16: "-internal-isystem" + // CHECK-EL-SF-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1574,7 +1518,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mips16 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-16 %s + // CHECK-EL-NAN-16: "-internal-isystem" + // CHECK-EL-NAN-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1602,7 +1545,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mips16 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-16 %s + // CHECK-EL-NAN64-16: "-internal-isystem" + // CHECK-EL-NAN64-16: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1630,7 +1572,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-32 %s + // CHECK-EL-NAN-32: "-internal-isystem" + // CHECK-EL-NAN-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1658,7 +1599,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-32 %s + // CHECK-EL-NAN64-32: "-internal-isystem" + // CHECK-EL-NAN64-32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1686,7 +1626,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-32R2 %s + // CHECK-EL-HF-32R2: "-internal-isystem" + // CHECK-EL-HF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1714,7 +1653,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mhard-float -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-UC-HF-32R2 %s + // CHECK-EL-UC-HF-32R2: "-internal-isystem" + // CHECK-EL-UC-HF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1742,7 +1680,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-32R2 %s + // CHECK-EL-HF64-32R2: "-internal-isystem" + // CHECK-EL-HF64-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1770,7 +1707,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-32R2 %s + // CHECK-EL-SF-32R2: "-internal-isystem" + // CHECK-EL-SF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1798,7 +1734,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -msoft-float -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-UC-SF-32R2 %s + // CHECK-EL-UC-SF-32R2: "-internal-isystem" + // CHECK-EL-UC-SF-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1826,7 +1761,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mips16 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-16R2 %s + // CHECK-EL-HF-16R2: "-internal-isystem" + // CHECK-EL-HF-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1854,7 +1788,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mips16 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-16R2 %s + // CHECK-EL-HF64-16R2: "-internal-isystem" + // CHECK-EL-HF64-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1882,7 +1815,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mips16 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-16R2 %s + // CHECK-EL-SF-16R2: "-internal-isystem" + // CHECK-EL-SF-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1910,7 +1842,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mips16 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-16R2 %s + // CHECK-EL-NAN-16R2: "-internal-isystem" + // CHECK-EL-NAN-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1938,7 +1869,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mips16 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-16R2 %s + // CHECK-EL-NAN64-16R2: "-internal-isystem" + // CHECK-EL-NAN64-16R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1966,7 +1896,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-32R2 %s + // CHECK-EL-NAN-32R2: "-internal-isystem" + // CHECK-EL-NAN-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -1994,7 +1923,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mnan=2008 -muclibc \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-UC-NAN-32R2 %s + // CHECK-EL-UC-NAN-32R2: "-internal-isystem" + // CHECK-EL-UC-NAN-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2022,7 +1950,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mips32r2 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-32R2 %s + // CHECK-EL-NAN64-32R2: "-internal-isystem" + // CHECK-EL-NAN64-32R2: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2050,7 +1977,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-32R2-DEF %s + // CHECK-EL-NAN64-32R2-DEF: "-internal-isystem" + // CHECK-EL-NAN64-32R2-DEF: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2078,7 +2004,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mmicromips -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-MM %s + // CHECK-EL-HF-MM: "-internal-isystem" + // CHECK-EL-HF-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2106,7 +2031,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mmicromips -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-MM %s + // CHECK-EL-HF64-MM: "-internal-isystem" + // CHECK-EL-HF64-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2134,7 +2058,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mmicromips -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-MM %s + // CHECK-EL-SF-MM: "-internal-isystem" + // CHECK-EL-SF-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2162,7 +2085,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mmicromips -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-MM %s + // CHECK-EL-NAN-MM: "-internal-isystem" + // CHECK-EL-NAN-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2190,7 +2112,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mipsel-mti-linux-gnu -mmicromips -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-MM %s + // CHECK-EL-NAN64-MM: "-internal-isystem" + // CHECK-EL-NAN64-MM: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2218,7 +2139,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=n32 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-64-N32 %s + // CHECK-EL-HF-64-N32: "-internal-isystem" + // CHECK-EL-HF-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2246,7 +2166,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=n32 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-64-N32 %s + // CHECK-EL-HF64-64-N32: "-internal-isystem" + // CHECK-EL-HF64-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2274,7 +2193,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=n32 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-64-N32 %s + // CHECK-EL-SF-64-N32: "-internal-isystem" + // CHECK-EL-SF-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2302,7 +2220,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=n32 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-64-N32 %s + // CHECK-EL-NAN-64-N32: "-internal-isystem" + // CHECK-EL-NAN-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2330,7 +2247,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=n32 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64-N32 %s + // CHECK-EL-NAN64-64-N32: "-internal-isystem" + // CHECK-EL-NAN64-64-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2358,7 +2274,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-64-64 %s + // CHECK-EL-HF-64-64: "-internal-isystem" + // CHECK-EL-HF-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2386,7 +2301,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=64 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-64-64 %s + // CHECK-EL-HF64-64-64: "-internal-isystem" + // CHECK-EL-HF64-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2414,7 +2328,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=64 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-64-64 %s + // CHECK-EL-SF-64-64: "-internal-isystem" + // CHECK-EL-SF-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2442,7 +2355,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-64-64 %s + // CHECK-EL-NAN-64-64: "-internal-isystem" + // CHECK-EL-NAN-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2470,7 +2382,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64 -mabi=64 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64-64 %s + // CHECK-EL-NAN64-64-64: "-internal-isystem" + // CHECK-EL-NAN64-64-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2498,7 +2409,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=n32 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-64R2-N32 %s + // CHECK-EL-HF-64R2-N32: "-internal-isystem" + // CHECK-EL-HF-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2526,7 +2436,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=n32 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-64R2-N32 %s + // CHECK-EL-HF64-64R2-N32: "-internal-isystem" + // CHECK-EL-HF64-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2554,7 +2463,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=n32 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-64R2-N32 %s + // CHECK-EL-SF-64R2-N32: "-internal-isystem" + // CHECK-EL-SF-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2582,7 +2490,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=n32 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-64R2-N32 %s + // CHECK-EL-NAN-64R2-N32: "-internal-isystem" + // CHECK-EL-NAN-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2610,7 +2517,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=n32 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64R2-N32 %s + // CHECK-EL-NAN64-64R2-N32: "-internal-isystem" + // CHECK-EL-NAN64-64R2-N32: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2638,7 +2544,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF-64R2-64 %s + // CHECK-EL-HF-64R2-64: "-internal-isystem" + // CHECK-EL-HF-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2666,7 +2571,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=64 -mfp64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-HF64-64R2-64 %s + // CHECK-EL-HF64-64R2-64: "-internal-isystem" + // CHECK-EL-HF64-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2694,7 +2598,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=64 -msoft-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-SF-64R2-64 %s + // CHECK-EL-SF-64R2-64: "-internal-isystem" + // CHECK-EL-SF-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2722,7 +2625,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN-64R2-64 %s + // CHECK-EL-NAN-64R2-64: "-internal-isystem" + // CHECK-EL-NAN-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2750,7 +2652,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mips64r2 -mabi=64 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64R2-64 %s + // CHECK-EL-NAN64-64R2-64: "-internal-isystem" + // CHECK-EL-NAN64-64R2-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2778,7 +2679,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64el-mti-linux-gnu -mabi=64 -mfp64 -mnan=2008 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-EL-NAN64-64R2-64-DEF %s + // CHECK-EL-NAN64-64R2-64-DEF: "-internal-isystem" + // CHECK-EL-NAN64-64R2-64-DEF: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2808,7 +2708,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r3 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R3 %s + // CHECK-BE-HF-32R3: "-internal-isystem" + // CHECK-BE-HF-32R3: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2836,7 +2735,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-mti-linux-gnu -mips32r5 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-32R5 %s + // CHECK-BE-HF-32R5: "-internal-isystem" + // CHECK-BE-HF-32R5: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2864,7 +2762,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r3 -mabi=64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-64R3-64 %s + // CHECK-BE-HF-64R3-64: "-internal-isystem" + // CHECK-BE-HF-64R3-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +@@ -2892,7 +2789,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-mti-linux-gnu -mips64r5 -mabi=64 -mhard-float \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_fsf_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-HF-64R5-64 %s + // CHECK-BE-HF-64R5-64: "-internal-isystem" + // CHECK-BE-HF-64R5-64: "[[TC:[^"]+/lib/gcc/mips-mti-linux-gnu/4.9.0]]/../../../../mips-mti-linux-gnu/include/c++/4.9.0" +diff --git a/clang/test/Driver/mips-img-v2.cpp b/clang/test/Driver/mips-img-v2.cpp +index 4b7fb7479..69250b716 100644 +--- a/clang/test/Driver/mips-img-v2.cpp ++++ b/clang/test/Driver/mips-img-v2.cpp +@@ -6,7 +6,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EB -mips32r6 -mhard-float -mabi=32 \ + // RUN: | FileCheck --check-prefix=EB-HARD-O32 %s +@@ -35,7 +34,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EB -mips64r6 -mhard-float -mabi=n32 \ + // RUN: | FileCheck --check-prefix=EB-HARD-N32 %s +@@ -64,7 +62,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EB -mips64r6 -mhard-float -mabi=64 \ + // RUN: | FileCheck --check-prefix=EB-HARD-N64 %s +@@ -93,7 +90,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EL -mips32r6 -mhard-float -mabi=32 \ + // RUN: | FileCheck --check-prefix=EL-HARD-O32 %s +@@ -122,7 +118,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EL -mips64r6 -mhard-float -mabi=n32 \ + // RUN: | FileCheck --check-prefix=EL-HARD-N32 %s +@@ -151,7 +146,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EL -mips64r6 -mhard-float -mabi=64 \ + // RUN: | FileCheck --check-prefix=EL-HARD-N64 %s +@@ -180,7 +174,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EB -mips32r6 -msoft-float \ + // RUN: | FileCheck --check-prefix=EB-SOFT %s +@@ -209,7 +202,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EL -mips32r6 -msoft-float \ + // RUN: | FileCheck --check-prefix=EL-SOFT %s +@@ -238,7 +230,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EB -mips32r6 -mhard-float -mmicromips \ + // RUN: | FileCheck --check-prefix=EB-HARD-MICRO %s +@@ -267,7 +258,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EB -mips32r6 -msoft-float -mmicromips \ + // RUN: | FileCheck --check-prefix=EB-SOFT-MICRO %s +@@ -296,7 +286,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EL -mips32r6 -mhard-float -mmicromips \ + // RUN: | FileCheck --check-prefix=EL-HARD-MICRO %s +@@ -325,7 +314,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu \ + // RUN: --gcc-toolchain=%S/Inputs/mips_img_v2_tree \ +-// RUN: --sysroot="" \ + // RUN: -stdlib=libstdc++ \ + // RUN: -EL -mips32r6 -msoft-float -mmicromips \ + // RUN: | FileCheck --check-prefix=EL-SOFT-MICRO %s +diff --git a/clang/test/Driver/mips-img.cpp b/clang/test/Driver/mips-img.cpp +index 5185167fe..c97bb9478 100644 +--- a/clang/test/Driver/mips-img.cpp ++++ b/clang/test/Driver/mips-img.cpp +@@ -6,7 +6,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu -mips32r6 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-32R6 %s + // CHECK-BE-32R6: "-internal-isystem" + // CHECK-BE-32R6: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0" +@@ -34,7 +33,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips-img-linux-gnu -mips32r6 -EL \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-LE-32R6 %s + // CHECK-LE-32R6: "-internal-isystem" + // CHECK-LE-32R6: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0" +@@ -62,7 +60,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-img-linux-gnu -mips64r6 -mabi=n32 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-64R6-N32 %s + // CHECK-BE-64R6-N32: "-internal-isystem" + // CHECK-BE-64R6-N32: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0" +@@ -90,7 +87,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-img-linux-gnu -mips64r6 -EL -mabi=n32 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-LE-64R6-N32 %s + // CHECK-LE-64R6-N32: "-internal-isystem" + // CHECK-LE-64R6-N32: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0" +@@ -118,7 +114,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-img-linux-gnu -mips64r6 -mabi=64 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-BE-64R6-N64 %s + // CHECK-BE-64R6-N64: "-internal-isystem" + // CHECK-BE-64R6-N64: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0" +@@ -146,7 +141,6 @@ + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=mips64-img-linux-gnu -mips64r6 -EL -mabi=64 \ + // RUN: -stdlib=libstdc++ --gcc-toolchain=%S/Inputs/mips_img_tree \ +-// RUN: --sysroot="" \ + // RUN: | FileCheck --check-prefix=CHECK-LE-64R6-N64 %s + // CHECK-LE-64R6-N64: "-internal-isystem" + // CHECK-LE-64R6-N64: "[[TC:[^"]+/lib/gcc/mips-img-linux-gnu/4.9.0]]/../../../../mips-img-linux-gnu/include/c++/4.9.0" +diff --git a/clang/test/Interpreter/execute.cpp b/clang/test/Interpreter/execute.cpp +index 2ff04ee11..298046c06 100644 +--- a/clang/test/Interpreter/execute.cpp ++++ b/clang/test/Interpreter/execute.cpp +@@ -1,7 +1,7 @@ + // RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \ + // RUN: 'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s + // REQUIRES: host-supports-jit +-// UNSUPPORTED: system-aix,loongarch ++// UNSUPPORTED: system-aix + // CHECK-DRIVER: i = 10 + // RUN: cat %s | clang-repl | FileCheck %s + extern "C" int printf(const char *, ...); diff --git a/clang.spec b/clang.spec index a08d0e0..d3c0631 100644 --- a/clang.spec +++ b/clang.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 %bcond_with compat_build %bcond_without check @@ -110,8 +110,10 @@ Patch2: 0003-PATCH-clang-Don-t-install-static-libraries.patch Patch3: 0001-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch Patch4: 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch Patch5: 0001-PATCH-clang-Fix-scan-build-py-executable-lookup-path.patch -Patch6: 0001-Support-LoongArch.patch +# Patches for LoongArch +Patch6: 0001-Support-LoongArch.patch +Patch7: 0002-pkg_an8_clang_13.0.1-1.0.2.patch # Patches for clang-tools-extra %if !0%{?compat_build} @@ -598,6 +600,10 @@ false %endif %changelog +* Tue Nov 08 2022 chenli - 13.0.1-2.0.2 +- [LoongArch] Define subtarget feature unaligned-access +- [compiler-rt] Support LoongArch64 + * Mon Jul 04 2022 chenli - 13.0.1-2.0.1 - Support LoongArch - Do not use gcc-toolset-11 on loongarch64 -- Gitee