From edad5bcb76bf472a1487c0f3dd94a5914213a647 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 2 Dec 2017 12:46:23 +0000 Subject: [PATCH 1/5] Vendor import of llvm release_50 branch r319231: https://llvm.org/svn/llvm-project/llvm/branches/release_50@319231 --- CMakeLists.txt | 6 +- docs/CMake.rst | 7 +- .../llvm/Analysis/TargetTransformInfoImpl.h | 6 + include/llvm/CodeGen/MachineRegisterInfo.h | 8 + include/llvm/IR/AutoUpgrade.h | 2 + include/llvm/Support/FormatVariadic.h | 17 + lib/AsmParser/LLParser.cpp | 1 + lib/Bitcode/Reader/BitcodeReader.cpp | 2 +- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 20 +- lib/CodeGen/AsmPrinter/DwarfDebug.h | 5 +- lib/CodeGen/AsmPrinter/DwarfExpression.cpp | 7 +- lib/CodeGen/LiveIntervalAnalysis.cpp | 10 +- lib/CodeGen/MachineRegisterInfo.cpp | 18 + lib/CodeGen/MachineVerifier.cpp | 2 + lib/IR/AutoUpgrade.cpp | 47 + lib/IR/ConstantFold.cpp | 3 + lib/Linker/IRMover.cpp | 4 + lib/Linker/LinkModules.cpp | 14 +- lib/Support/Host.cpp | 1 + lib/Target/AArch64/AArch64FalkorHWPFFix.cpp | 128 +- lib/Target/AArch64/AArch64ISelLowering.cpp | 19 +- lib/Target/AArch64/AArch64InstrInfo.cpp | 6 + lib/Target/AArch64/AArch64InstrInfo.td | 3 +- .../AArch64RedundantCopyElimination.cpp | 3 + lib/Target/AMDGPU/GCNHazardRecognizer.cpp | 13 +- lib/Target/ARM/ARMAsmPrinter.cpp | 2 + lib/Target/ARM/ARMCallLowering.cpp | 4 +- lib/Target/ARM/ARMExpandPseudoInsts.cpp | 5 +- lib/Target/ARM/ARMFastISel.cpp | 5 +- lib/Target/ARM/ARMFrameLowering.cpp | 7 +- lib/Target/ARM/ARMInstrInfo.td | 8 +- lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 1 + lib/Target/ARM/ARMSubtarget.h | 11 + .../ARM/MCTargetDesc/ARMMCTargetDesc.cpp | 4 +- lib/Target/AVR/AVRExpandPseudoInsts.cpp | 69 +- lib/Target/AVR/AVRISelLowering.cpp | 6 +- lib/Target/AVR/AVRISelLowering.h | 5 + lib/Target/AVR/AVRInstrInfo.cpp | 18 +- lib/Target/AVR/AVRInstrInfo.h | 6 + lib/Target/AVR/AVRInstrInfo.td | 70 +- lib/Target/AVR/AVRRegisterInfo.cpp | 2 +- lib/Target/AVR/AVRTargetMachine.cpp | 2 +- .../AVR/MCTargetDesc/AVRTargetStreamer.cpp | 20 + .../AVR/MCTargetDesc/AVRTargetStreamer.h | 2 + lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 234 +- lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp | 8 +- .../Mips/MCTargetDesc/MipsTargetStreamer.cpp | 15 + lib/Target/Mips/MicroMipsDSPInstrInfo.td | 7 + lib/Target/Mips/MipsDSPInstrInfo.td | 6 + lib/Target/Mips/MipsFrameLowering.cpp | 35 +- lib/Target/Mips/MipsMTInstrFormats.td | 21 + lib/Target/Mips/MipsMTInstrInfo.td | 110 + lib/Target/Mips/MipsSEFrameLowering.cpp | 8 +- lib/Target/Mips/MipsSEInstrInfo.cpp | 4 + lib/Target/Mips/MipsSchedule.td | 4 + lib/Target/Mips/MipsScheduleGeneric.td | 4 +- lib/Target/Mips/MipsTargetStreamer.h | 3 + lib/Target/X86/X86ISelLowering.cpp | 17 + test/Bitcode/upgrade-module-flag.ll | 6 +- test/Bitcode/upgrade-section-name.ll | 31 + test/CodeGen/AArch64/arm64-memset-inline.ll | 4 +- test/CodeGen/AArch64/cmp-frameindex.ll | 19 + test/CodeGen/AArch64/falkor-hwpf-fix.mir | 306 +- test/CodeGen/AArch64/fastcc.ll | 12 +- test/CodeGen/AArch64/ldst-opt.ll | 15 +- test/CodeGen/AArch64/thread-pointer.ll | 60 - test/CodeGen/AMDGPU/hazard.mir | 31 + .../ARM/GlobalISel/arm-irtranslator.ll | 4 +- test/CodeGen/ARM/armv4.ll | 17 +- test/CodeGen/ARM/debug-segmented-stacks.ll | 4 +- test/CodeGen/ARM/no-fpscr-liveness.ll | 49 + test/CodeGen/ARM/pr32578.ll | 27 + test/CodeGen/ARM/segmented-stacks-dynamic.ll | 8 +- test/CodeGen/ARM/segmented-stacks.ll | 4 +- .../load-store-16-unexpected-register-bug.ll | 23 + test/CodeGen/AVR/atomics/load16.ll | 22 +- test/CodeGen/AVR/branch-relaxation-long.ll | 4137 +++++++++++++++++ test/CodeGen/AVR/call.ll | 6 +- test/CodeGen/AVR/clear-bss.ll | 5 + test/CodeGen/AVR/copy-data-to-ram.ll | 5 + test/CodeGen/AVR/directmem.ll | 8 +- test/CodeGen/AVR/load.ll | 14 +- .../AVR/pseudo/LDWRdPtr-same-src-dst.mir | 4 +- test/CodeGen/AVR/pseudo/LDWRdPtr.mir | 4 +- test/CodeGen/AVR/pseudo/LDWRdPtrPd.mir | 4 +- test/CodeGen/AVR/pseudo/LDWRdPtrPi.mir | 4 +- .../CodeGen/AVR/std-ldd-immediate-overflow.ll | 18 + test/CodeGen/AVR/varargs.ll | 4 +- test/CodeGen/Mips/dsp-spill-reload.ll | 52 + test/CodeGen/Mips/msa/emergency-spill.mir | 212 + test/CodeGen/Mips/msa/frameindex.ll | 49 +- test/CodeGen/X86/fp128-cast.ll | 65 + test/CodeGen/X86/pr34605.ll | 63 + test/DebugInfo/Sparc/subreg.ll | 35 + test/DebugInfo/cross-cu-scope.ll | 50 + .../X86/function-alias-non-prevailing.ll | 17 + .../Inputs/only-needed-compiler-used.ll | 7 + test/Linker/Inputs/only-needed-ctors.ll | 20 + test/Linker/Inputs/only-needed-dtors.ll | 20 + test/Linker/Inputs/only-needed-used.ll | 7 + test/Linker/only-needed-compiler-used.ll | 13 + test/Linker/only-needed-ctors1.ll | 15 + test/Linker/only-needed-ctors2.ll | 28 + test/Linker/only-needed-dtors1.ll | 15 + test/Linker/only-needed-dtors2.ll | 28 + test/Linker/only-needed-used.ll | 11 + test/MC/Disassembler/Mips/mt/valid-r2-el.txt | 21 +- test/MC/Disassembler/Mips/mt/valid-r2.txt | 21 +- .../Mips/macro-aliases-invalid-wrong-error.s | 38 + test/MC/Mips/macro-aliases.s | 35 + test/MC/Mips/mt/invalid-wrong-error.s | 4 + test/MC/Mips/mt/invalid.s | 1 + .../mftr-mttr-aliases-invalid-wrong-error.s | 18 + test/MC/Mips/mt/mftr-mttr-aliases-invalid.s | 23 + test/MC/Mips/mt/mftr-mttr-aliases.s | 47 + test/MC/Mips/mt/mftr-mttr-reserved-valid.s | 8 + test/MC/Mips/mt/valid.s | 42 +- test/MC/Mips/tls-symbols.s | 28 + test/Transforms/InstCombine/gep-vector.ll | 9 + test/Transforms/SimplifyCFG/gepcost.ll | 28 + unittests/Support/FormatVariadicTest.cpp | 6 + unittests/Support/Host.cpp | 3 + utils/release/merge-request.sh | 90 +- 123 files changed, 6681 insertions(+), 378 deletions(-) create mode 100644 test/Bitcode/upgrade-section-name.ll create mode 100644 test/CodeGen/AArch64/cmp-frameindex.ll delete mode 100644 test/CodeGen/AArch64/thread-pointer.ll create mode 100644 test/CodeGen/AMDGPU/hazard.mir create mode 100644 test/CodeGen/ARM/no-fpscr-liveness.ll create mode 100644 test/CodeGen/ARM/pr32578.ll create mode 100644 test/CodeGen/AVR/atomics/load-store-16-unexpected-register-bug.ll create mode 100644 test/CodeGen/AVR/branch-relaxation-long.ll create mode 100644 test/CodeGen/AVR/clear-bss.ll create mode 100644 test/CodeGen/AVR/copy-data-to-ram.ll create mode 100644 test/CodeGen/AVR/std-ldd-immediate-overflow.ll create mode 100644 test/CodeGen/Mips/dsp-spill-reload.ll create mode 100644 test/CodeGen/Mips/msa/emergency-spill.mir create mode 100644 test/CodeGen/X86/pr34605.ll create mode 100644 test/DebugInfo/Sparc/subreg.ll create mode 100644 test/DebugInfo/cross-cu-scope.ll create mode 100644 test/LTO/Resolution/X86/function-alias-non-prevailing.ll create mode 100644 test/Linker/Inputs/only-needed-compiler-used.ll create mode 100644 test/Linker/Inputs/only-needed-ctors.ll create mode 100644 test/Linker/Inputs/only-needed-dtors.ll create mode 100644 test/Linker/Inputs/only-needed-used.ll create mode 100644 test/Linker/only-needed-compiler-used.ll create mode 100644 test/Linker/only-needed-ctors1.ll create mode 100644 test/Linker/only-needed-ctors2.ll create mode 100644 test/Linker/only-needed-dtors1.ll create mode 100644 test/Linker/only-needed-dtors2.ll create mode 100644 test/Linker/only-needed-used.ll create mode 100644 test/MC/Mips/macro-aliases-invalid-wrong-error.s create mode 100644 test/MC/Mips/macro-aliases.s create mode 100644 test/MC/Mips/mt/invalid-wrong-error.s create mode 100644 test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s create mode 100644 test/MC/Mips/mt/mftr-mttr-aliases-invalid.s create mode 100644 test/MC/Mips/mt/mftr-mttr-aliases.s create mode 100644 test/MC/Mips/mt/mftr-mttr-reserved-valid.s create mode 100644 test/MC/Mips/tls-symbols.s create mode 100644 test/Transforms/SimplifyCFG/gepcost.ll diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c0f51145139..960febf60074 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ if(NOT DEFINED LLVM_VERSION_MINOR) set(LLVM_VERSION_MINOR 0) endif() if(NOT DEFINED LLVM_VERSION_PATCH) - set(LLVM_VERSION_PATCH 0) + set(LLVM_VERSION_PATCH 1) endif() if(NOT DEFINED LLVM_VERSION_SUFFIX) set(LLVM_VERSION_SUFFIX "") @@ -208,10 +208,6 @@ include(VersionFromVCS) option(LLVM_APPEND_VC_REV "Embed the version control system revision id in LLVM" ON) -if( LLVM_APPEND_VC_REV ) - add_version_info_from_vcs(PACKAGE_VERSION) -endif() - set(PACKAGE_NAME LLVM) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "http://llvm.org/bugs/") diff --git a/docs/CMake.rst b/docs/CMake.rst index bf97e9173158..b6ebf37adc92 100644 --- a/docs/CMake.rst +++ b/docs/CMake.rst @@ -248,9 +248,10 @@ LLVM-specific variables **LLVM_APPEND_VC_REV**:BOOL Embed version control revision info (svn revision number or Git revision id). - This is used among other things in the LLVM version string (stored in the - PACKAGE_VERSION macro). For this to work cmake must be invoked before the - build. Defaults to ON. + The version info is provided by the ``LLVM_REVISION`` macro in + ``llvm/include/llvm/Support/VCSRevision.h``. Developers using git who don't + need revision info can disable this option to avoid re-linking most binaries + after a branch switch. Defaults to ON. **LLVM_ENABLE_THREADS**:BOOL Build with threads support, if available. Defaults to ON. diff --git a/include/llvm/Analysis/TargetTransformInfoImpl.h b/include/llvm/Analysis/TargetTransformInfoImpl.h index 0b07fe9aa232..9bbda718acab 100644 --- a/include/llvm/Analysis/TargetTransformInfoImpl.h +++ b/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -652,6 +652,12 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase { auto GTI = gep_type_begin(PointeeType, Operands); Type *TargetType; + + // Handle the case where the GEP instruction has a single operand, + // the basis, therefore TargetType is a nullptr. + if (Operands.empty()) + return !BaseGV ? TTI::TCC_Free : TTI::TCC_Basic; + for (auto I = Operands.begin(); I != Operands.end(); ++I, ++GTI) { TargetType = GTI.getIndexedType(); // We assume that the cost of Scalar GEP with constant index and the diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index 8347f00cbc7a..5ef0ac90e3c2 100644 --- a/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/include/llvm/CodeGen/MachineRegisterInfo.h @@ -807,6 +807,14 @@ class MachineRegisterInfo { return getReservedRegs().test(PhysReg); } + /// Returns true when the given register unit is considered reserved. + /// + /// Register units are considered reserved when for at least one of their + /// root registers, the root register and all super registers are reserved. + /// This currently iterates the register hierarchy and may be slower than + /// expected. + bool isReservedRegUnit(unsigned Unit) const; + /// isAllocatable - Returns true when PhysReg belongs to an allocatable /// register class and it hasn't been reserved. /// diff --git a/include/llvm/IR/AutoUpgrade.h b/include/llvm/IR/AutoUpgrade.h index b42a3d3ad955..3f406f0cf196 100644 --- a/include/llvm/IR/AutoUpgrade.h +++ b/include/llvm/IR/AutoUpgrade.h @@ -51,6 +51,8 @@ namespace llvm { /// module is modified. bool UpgradeModuleFlags(Module &M); + void UpgradeSectionAttributes(Module &M); + /// If the given TBAA tag uses the scalar TBAA format, create a new node /// corresponding to the upgrade to the struct-path aware TBAA format. /// Otherwise return the \p TBAANode itself. diff --git a/include/llvm/Support/FormatVariadic.h b/include/llvm/Support/FormatVariadic.h index c1153e84dfb5..408c6d8b2e0d 100644 --- a/include/llvm/Support/FormatVariadic.h +++ b/include/llvm/Support/FormatVariadic.h @@ -94,6 +94,15 @@ class formatv_object_base { Adapters.reserve(ParamCount); } + formatv_object_base(formatv_object_base const &rhs) = delete; + + formatv_object_base(formatv_object_base &&rhs) + : Fmt(std::move(rhs.Fmt)), + Adapters(), // Adapters are initialized by formatv_object + Replacements(std::move(rhs.Replacements)) { + Adapters.reserve(rhs.Adapters.size()); + }; + void format(raw_ostream &S) const { for (auto &R : Replacements) { if (R.Type == ReplacementType::Empty) @@ -149,6 +158,14 @@ template class formatv_object : public formatv_object_base { Parameters(std::move(Params)) { Adapters = apply_tuple(create_adapters(), Parameters); } + + formatv_object(formatv_object const &rhs) = delete; + + formatv_object(formatv_object &&rhs) + : formatv_object_base(std::move(rhs)), + Parameters(std::move(rhs.Parameters)) { + Adapters = apply_tuple(create_adapters(), Parameters); + } }; // \brief Format text given a format string and replacement parameters. diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 13679ce1d25c..234805a05245 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -240,6 +240,7 @@ bool LLParser::ValidateEndOfModule() { UpgradeDebugInfo(*M); UpgradeModuleFlags(*M); + UpgradeSectionAttributes(*M); if (!Slots) return false; diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 2b4970a80cdd..048e3672f471 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -264,7 +264,7 @@ Expected hasObjCCategoryInModule(BitstreamCursor &Stream) { if (convertToString(Record, 0, S)) return error("Invalid record"); // Check for the i386 and other (x86_64, ARM) conventions - if (S.find("__DATA, __objc_catlist") != std::string::npos || + if (S.find("__DATA,__objc_catlist") != std::string::npos || S.find("__OBJC,__category") != std::string::npos) return true; break; diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 676c48fe5c67..333d14a11af5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -621,6 +621,7 @@ void DwarfCompileUnit::constructAbstractSubprogramScopeDIE( auto *SP = cast(Scope->getScopeNode()); DIE *ContextDIE; + DwarfCompileUnit *ContextCU = this; if (includeMinimalInlineScopes()) ContextDIE = &getUnitDie(); @@ -631,18 +632,23 @@ void DwarfCompileUnit::constructAbstractSubprogramScopeDIE( else if (auto *SPDecl = SP->getDeclaration()) { ContextDIE = &getUnitDie(); getOrCreateSubprogramDIE(SPDecl); - } else + } else { ContextDIE = getOrCreateContextDIE(resolve(SP->getScope())); + // The scope may be shared with a subprogram that has already been + // constructed in another CU, in which case we need to construct this + // subprogram in the same CU. + ContextCU = DD->lookupCU(ContextDIE->getUnitDie()); + } // Passing null as the associated node because the abstract definition // shouldn't be found by lookup. - AbsDef = &createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr); - applySubprogramAttributesToDefinition(SP, *AbsDef); + AbsDef = &ContextCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr); + ContextCU->applySubprogramAttributesToDefinition(SP, *AbsDef); - if (!includeMinimalInlineScopes()) - addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined); - if (DIE *ObjectPointer = createAndAddScopeChildren(Scope, *AbsDef)) - addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); + if (!ContextCU->includeMinimalInlineScopes()) + ContextCU->addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined); + if (DIE *ObjectPointer = ContextCU->createAndAddScopeChildren(Scope, *AbsDef)) + ContextCU->addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); } DIE *DwarfCompileUnit::constructImportedEntityDIE( diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 5dfe06c64ec2..78ee9a162029 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -283,7 +283,7 @@ class DwarfDebug : public DebugHandlerBase { // 0, referencing the comp_dir of all the type units that use it. MCDwarfDwoLineTable SplitTypeUnitFileTable; /// @} - + /// True iff there are multiple CUs in this module. bool SingleCU; bool IsDarwin; @@ -562,6 +562,9 @@ class DwarfDebug : public DebugHandlerBase { bool isLexicalScopeDIENull(LexicalScope *Scope); bool hasDwarfPubSections(bool includeMinimalInlineScopes) const; + + /// Find the matching DwarfCompileUnit for the given CU DIE. + DwarfCompileUnit *lookupCU(const DIE *Die) { return CUDieMap.lookup(Die); } }; } // End of namespace llvm diff --git a/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/lib/CodeGen/AsmPrinter/DwarfExpression.cpp index fe38ee805682..3a8568cf39ae 100644 --- a/lib/CodeGen/AsmPrinter/DwarfExpression.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfExpression.cpp @@ -131,13 +131,12 @@ bool DwarfExpression::addMachineReg(const TargetRegisterInfo &TRI, // Intersection between the bits we already emitted and the bits // covered by this subregister. - SmallBitVector Intersection(RegSize, false); - Intersection.set(Offset, Offset + Size); - Intersection ^= Coverage; + SmallBitVector CurSubReg(RegSize, false); + CurSubReg.set(Offset, Offset + Size); // If this sub-register has a DWARF number and we haven't covered // its range, emit a DWARF piece for it. - if (Reg >= 0 && Intersection.any()) { + if (Reg >= 0 && CurSubReg.test(Coverage)) { // Emit a piece for any gap in the coverage. if (Offset > CurPos) DwarfRegs.push_back({-1, Offset - CurPos, nullptr}); diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 471dcea4bb39..0e240f482a19 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -269,8 +269,9 @@ void LiveIntervals::computeRegUnitRange(LiveRange &LR, unsigned Unit) { // may share super-registers. That's OK because createDeadDefs() is // idempotent. It is very rare for a register unit to have multiple roots, so // uniquing super-registers is probably not worthwhile. - bool IsReserved = true; + bool IsReserved = false; for (MCRegUnitRootIterator Root(Unit, TRI); Root.isValid(); ++Root) { + bool IsRootReserved = true; for (MCSuperRegIterator Super(*Root, TRI, /*IncludeSelf=*/true); Super.isValid(); ++Super) { unsigned Reg = *Super; @@ -279,9 +280,12 @@ void LiveIntervals::computeRegUnitRange(LiveRange &LR, unsigned Unit) { // A register unit is considered reserved if all its roots and all their // super registers are reserved. if (!MRI->isReserved(Reg)) - IsReserved = false; + IsRootReserved = false; } + IsReserved |= IsRootReserved; } + assert(IsReserved == MRI->isReservedRegUnit(Unit) && + "reserved computation mismatch"); // Now extend LR to reach all uses. // Ignore uses of reserved registers. We only track defs of those. @@ -924,7 +928,7 @@ class LiveIntervals::HMEditor { // kill flags. This is wasteful. Eventually, LiveVariables will strip all kill // flags, and postRA passes will use a live register utility instead. LiveRange *getRegUnitLI(unsigned Unit) { - if (UpdateFlags) + if (UpdateFlags && !MRI.isReservedRegUnit(Unit)) return &LIS.getRegUnit(Unit); return LIS.getCachedRegUnit(Unit); } diff --git a/lib/CodeGen/MachineRegisterInfo.cpp b/lib/CodeGen/MachineRegisterInfo.cpp index 9a92ee279cdc..be06053f0040 100644 --- a/lib/CodeGen/MachineRegisterInfo.cpp +++ b/lib/CodeGen/MachineRegisterInfo.cpp @@ -601,3 +601,21 @@ void MachineRegisterInfo::setCalleeSavedRegs(ArrayRef CSRs) { UpdatedCSRs.push_back(0); IsUpdatedCSRsInitialized = true; } + +bool MachineRegisterInfo::isReservedRegUnit(unsigned Unit) const { + const TargetRegisterInfo *TRI = getTargetRegisterInfo(); + for (MCRegUnitRootIterator Root(Unit, TRI); Root.isValid(); ++Root) { + bool IsRootReserved = true; + for (MCSuperRegIterator Super(*Root, TRI, /*IncludeSelf=*/true); + Super.isValid(); ++Super) { + unsigned Reg = *Super; + if (!isReserved(Reg)) { + IsRootReserved = false; + break; + } + } + if (IsRootReserved) + return true; + } + return false; +} diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp index fcb544806dda..c50a95a06505 100644 --- a/lib/CodeGen/MachineVerifier.cpp +++ b/lib/CodeGen/MachineVerifier.cpp @@ -1316,6 +1316,8 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) { // Check the cached regunit intervals. if (TargetRegisterInfo::isPhysicalRegister(Reg) && !isReserved(Reg)) { for (MCRegUnitIterator Units(Reg, TRI); Units.isValid(); ++Units) { + if (MRI->isReservedRegUnit(*Units)) + continue; if (const LiveRange *LR = LiveInts->getCachedRegUnit(*Units)) checkLivenessAtUse(MO, MONum, UseIdx, *LR, *Units); } diff --git a/lib/IR/AutoUpgrade.cpp b/lib/IR/AutoUpgrade.cpp index a501799b4799..80640def955e 100644 --- a/lib/IR/AutoUpgrade.cpp +++ b/lib/IR/AutoUpgrade.cpp @@ -2271,6 +2271,24 @@ bool llvm::UpgradeModuleFlags(Module &M) { } } } + // Upgrade Objective-C Image Info Section. Removed the whitespce in the + // section name so that llvm-lto will not complain about mismatching + // module flags that is functionally the same. + if (ID->getString() == "Objective-C Image Info Section") { + if (auto *Value = dyn_cast_or_null(Op->getOperand(2))) { + SmallVector ValueComp; + Value->getString().split(ValueComp, " "); + if (ValueComp.size() != 1) { + std::string NewValue; + for (auto &S : ValueComp) + NewValue += S.str(); + Metadata *Ops[3] = {Op->getOperand(0), Op->getOperand(1), + MDString::get(M.getContext(), NewValue)}; + ModFlags->setOperand(I, MDNode::get(M.getContext(), Ops)); + Changed = true; + } + } + } } // "Objective-C Class Properties" is recently added for Objective-C. We @@ -2287,6 +2305,35 @@ bool llvm::UpgradeModuleFlags(Module &M) { return Changed; } +void llvm::UpgradeSectionAttributes(Module &M) { + auto TrimSpaces = [](StringRef Section) -> std::string { + SmallVector Components; + Section.split(Components, ','); + + SmallString<32> Buffer; + raw_svector_ostream OS(Buffer); + + for (auto Component : Components) + OS << ',' << Component.trim(); + + return OS.str().substr(1); + }; + + for (auto &GV : M.globals()) { + if (!GV.hasSection()) + continue; + + StringRef Section = GV.getSection(); + + if (!Section.startswith("__DATA, __objc_catlist")) + continue; + + // __DATA, __objc_catlist, regular, no_dead_strip + // __DATA,__objc_catlist,regular,no_dead_strip + GV.setSection(TrimSpaces(Section)); + } +} + static bool isOldLoopArgument(Metadata *MD) { auto *T = dyn_cast_or_null(MD); if (!T) diff --git a/lib/IR/ConstantFold.cpp b/lib/IR/ConstantFold.cpp index 311b0a76ce8a..996331e68e83 100644 --- a/lib/IR/ConstantFold.cpp +++ b/lib/IR/ConstantFold.cpp @@ -2199,6 +2199,9 @@ Constant *llvm::ConstantFoldGetElementPtr(Type *PointeeTy, Constant *C, Unknown = true; continue; } + if (!isa(Idxs[i - 1])) + // FIXME: add the support of cosntant vector index. + continue; if (InRangeIndex && i == *InRangeIndex + 1) { // If an index is marked inrange, we cannot apply this canonicalization to // the following index, as that will cause the inrange index to point to diff --git a/lib/Linker/IRMover.cpp b/lib/Linker/IRMover.cpp index f486e525b5e7..ee067a912e3c 100644 --- a/lib/Linker/IRMover.cpp +++ b/lib/Linker/IRMover.cpp @@ -640,6 +640,10 @@ GlobalValue *IRLinker::copyGlobalValueProto(const GlobalValue *SGV, } else { if (ForDefinition) NewGV = copyGlobalAliasProto(cast(SGV)); + else if (SGV->getValueType()->isFunctionTy()) + NewGV = + Function::Create(cast(TypeMap.get(SGV->getValueType())), + GlobalValue::ExternalLinkage, SGV->getName(), &DstM); else NewGV = new GlobalVariable( DstM, TypeMap.get(SGV->getValueType()), diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index c0ce4bf76b9f..25f31a3401a6 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -329,8 +329,18 @@ bool ModuleLinker::shouldLinkFromSource(bool &LinkFromSrc, bool ModuleLinker::linkIfNeeded(GlobalValue &GV) { GlobalValue *DGV = getLinkedToGlobal(&GV); - if (shouldLinkOnlyNeeded() && !(DGV && DGV->isDeclaration())) - return false; + if (shouldLinkOnlyNeeded()) { + // Always import variables with appending linkage. + if (!GV.hasAppendingLinkage()) { + // Don't import globals unless they are referenced by the destination + // module. + if (!DGV) + return false; + // Don't import globals that are already defined in the destination module + if (!DGV->isDeclaration()) + return false; + } + } if (DGV && !GV.hasLocalLinkage() && !GV.hasAppendingLinkage()) { auto *DGVar = dyn_cast(DGV); diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp index 5cf0316d4d71..f1c0d3ac32d2 100644 --- a/lib/Support/Host.cpp +++ b/lib/Support/Host.cpp @@ -208,6 +208,7 @@ StringRef sys::detail::getHostCPUNameForARM( .Case("0x06f", "krait") // APQ8064 .Case("0x201", "kryo") .Case("0x205", "kryo") + .Case("0xc00", "falkor") .Default("generic"); return "generic"; diff --git a/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp b/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp index c0e22355a9ff..2c887a9ca5db 100644 --- a/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp +++ b/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp @@ -220,27 +220,27 @@ static Optional getLoadInfo(const MachineInstr &MI) { default: return None; - case AArch64::LD1i8: - case AArch64::LD1i16: - case AArch64::LD1i32: case AArch64::LD1i64: - case AArch64::LD2i8: - case AArch64::LD2i16: - case AArch64::LD2i32: case AArch64::LD2i64: - case AArch64::LD3i8: - case AArch64::LD3i16: - case AArch64::LD3i32: - case AArch64::LD4i8: - case AArch64::LD4i16: - case AArch64::LD4i32: DestRegIdx = 0; BaseRegIdx = 3; OffsetIdx = -1; IsPrePost = false; break; + case AArch64::LD1i8: + case AArch64::LD1i16: + case AArch64::LD1i32: + case AArch64::LD2i8: + case AArch64::LD2i16: + case AArch64::LD2i32: + case AArch64::LD3i8: + case AArch64::LD3i16: + case AArch64::LD3i32: case AArch64::LD3i64: + case AArch64::LD4i8: + case AArch64::LD4i16: + case AArch64::LD4i32: case AArch64::LD4i64: DestRegIdx = -1; BaseRegIdx = 3; @@ -264,23 +264,16 @@ static Optional getLoadInfo(const MachineInstr &MI) { case AArch64::LD1Rv4s: case AArch64::LD1Rv8h: case AArch64::LD1Rv16b: - case AArch64::LD1Twov1d: - case AArch64::LD1Twov2s: - case AArch64::LD1Twov4h: - case AArch64::LD1Twov8b: - case AArch64::LD2Twov2s: - case AArch64::LD2Twov4s: - case AArch64::LD2Twov8b: - case AArch64::LD2Rv1d: - case AArch64::LD2Rv2s: - case AArch64::LD2Rv4s: - case AArch64::LD2Rv8b: DestRegIdx = 0; BaseRegIdx = 1; OffsetIdx = -1; IsPrePost = false; break; + case AArch64::LD1Twov1d: + case AArch64::LD1Twov2s: + case AArch64::LD1Twov4h: + case AArch64::LD1Twov8b: case AArch64::LD1Twov2d: case AArch64::LD1Twov4s: case AArch64::LD1Twov8h: @@ -301,10 +294,17 @@ static Optional getLoadInfo(const MachineInstr &MI) { case AArch64::LD1Fourv4s: case AArch64::LD1Fourv8h: case AArch64::LD1Fourv16b: + case AArch64::LD2Twov2s: + case AArch64::LD2Twov4s: + case AArch64::LD2Twov8b: case AArch64::LD2Twov2d: case AArch64::LD2Twov4h: case AArch64::LD2Twov8h: case AArch64::LD2Twov16b: + case AArch64::LD2Rv1d: + case AArch64::LD2Rv2s: + case AArch64::LD2Rv4s: + case AArch64::LD2Rv8b: case AArch64::LD2Rv2d: case AArch64::LD2Rv4h: case AArch64::LD2Rv8h: @@ -345,32 +345,32 @@ static Optional getLoadInfo(const MachineInstr &MI) { IsPrePost = false; break; - case AArch64::LD1i8_POST: - case AArch64::LD1i16_POST: - case AArch64::LD1i32_POST: case AArch64::LD1i64_POST: - case AArch64::LD2i8_POST: - case AArch64::LD2i16_POST: - case AArch64::LD2i32_POST: case AArch64::LD2i64_POST: - case AArch64::LD3i8_POST: - case AArch64::LD3i16_POST: - case AArch64::LD3i32_POST: - case AArch64::LD4i8_POST: - case AArch64::LD4i16_POST: - case AArch64::LD4i32_POST: DestRegIdx = 1; BaseRegIdx = 4; OffsetIdx = 5; - IsPrePost = false; + IsPrePost = true; break; + case AArch64::LD1i8_POST: + case AArch64::LD1i16_POST: + case AArch64::LD1i32_POST: + case AArch64::LD2i8_POST: + case AArch64::LD2i16_POST: + case AArch64::LD2i32_POST: + case AArch64::LD3i8_POST: + case AArch64::LD3i16_POST: + case AArch64::LD3i32_POST: case AArch64::LD3i64_POST: + case AArch64::LD4i8_POST: + case AArch64::LD4i16_POST: + case AArch64::LD4i32_POST: case AArch64::LD4i64_POST: DestRegIdx = -1; BaseRegIdx = 4; OffsetIdx = 5; - IsPrePost = false; + IsPrePost = true; break; case AArch64::LD1Onev1d_POST: @@ -389,23 +389,16 @@ static Optional getLoadInfo(const MachineInstr &MI) { case AArch64::LD1Rv4s_POST: case AArch64::LD1Rv8h_POST: case AArch64::LD1Rv16b_POST: + DestRegIdx = 1; + BaseRegIdx = 2; + OffsetIdx = 3; + IsPrePost = true; + break; + case AArch64::LD1Twov1d_POST: case AArch64::LD1Twov2s_POST: case AArch64::LD1Twov4h_POST: case AArch64::LD1Twov8b_POST: - case AArch64::LD2Twov2s_POST: - case AArch64::LD2Twov4s_POST: - case AArch64::LD2Twov8b_POST: - case AArch64::LD2Rv1d_POST: - case AArch64::LD2Rv2s_POST: - case AArch64::LD2Rv4s_POST: - case AArch64::LD2Rv8b_POST: - DestRegIdx = 1; - BaseRegIdx = 2; - OffsetIdx = 3; - IsPrePost = false; - break; - case AArch64::LD1Twov2d_POST: case AArch64::LD1Twov4s_POST: case AArch64::LD1Twov8h_POST: @@ -426,10 +419,17 @@ static Optional getLoadInfo(const MachineInstr &MI) { case AArch64::LD1Fourv4s_POST: case AArch64::LD1Fourv8h_POST: case AArch64::LD1Fourv16b_POST: + case AArch64::LD2Twov2s_POST: + case AArch64::LD2Twov4s_POST: + case AArch64::LD2Twov8b_POST: case AArch64::LD2Twov2d_POST: case AArch64::LD2Twov4h_POST: case AArch64::LD2Twov8h_POST: case AArch64::LD2Twov16b_POST: + case AArch64::LD2Rv1d_POST: + case AArch64::LD2Rv2s_POST: + case AArch64::LD2Rv4s_POST: + case AArch64::LD2Rv8b_POST: case AArch64::LD2Rv2d_POST: case AArch64::LD2Rv4h_POST: case AArch64::LD2Rv8h_POST: @@ -467,7 +467,7 @@ static Optional getLoadInfo(const MachineInstr &MI) { DestRegIdx = -1; BaseRegIdx = 2; OffsetIdx = 3; - IsPrePost = false; + IsPrePost = true; break; case AArch64::LDRBBroW: @@ -572,8 +572,12 @@ static Optional getLoadInfo(const MachineInstr &MI) { IsPrePost = true; break; - case AArch64::LDPDi: + case AArch64::LDNPDi: + case AArch64::LDNPQi: + case AArch64::LDNPSi: case AArch64::LDPQi: + case AArch64::LDPDi: + case AArch64::LDPSi: DestRegIdx = -1; BaseRegIdx = 2; OffsetIdx = 3; @@ -581,7 +585,6 @@ static Optional getLoadInfo(const MachineInstr &MI) { break; case AArch64::LDPSWi: - case AArch64::LDPSi: case AArch64::LDPWi: case AArch64::LDPXi: DestRegIdx = 0; @@ -592,18 +595,18 @@ static Optional getLoadInfo(const MachineInstr &MI) { case AArch64::LDPQpost: case AArch64::LDPQpre: + case AArch64::LDPDpost: + case AArch64::LDPDpre: + case AArch64::LDPSpost: + case AArch64::LDPSpre: DestRegIdx = -1; BaseRegIdx = 3; OffsetIdx = 4; IsPrePost = true; break; - case AArch64::LDPDpost: - case AArch64::LDPDpre: case AArch64::LDPSWpost: case AArch64::LDPSWpre: - case AArch64::LDPSpost: - case AArch64::LDPSpre: case AArch64::LDPWpost: case AArch64::LDPWpre: case AArch64::LDPXpost: @@ -687,9 +690,14 @@ void FalkorHWPFFix::runOnLoop(MachineLoop &L, MachineFunction &Fn) { if (!TII->isStridedAccess(MI)) continue; - LoadInfo LdI = *getLoadInfo(MI); - unsigned OldTag = *getTag(TRI, MI, LdI); - auto &OldCollisions = TagMap[OldTag]; + Optional OptLdI = getLoadInfo(MI); + if (!OptLdI) + continue; + LoadInfo LdI = *OptLdI; + Optional OptOldTag = getTag(TRI, MI, LdI); + if (!OptOldTag) + continue; + auto &OldCollisions = TagMap[*OptOldTag]; if (OldCollisions.size() <= 1) continue; diff --git a/lib/Target/AArch64/AArch64ISelLowering.cpp b/lib/Target/AArch64/AArch64ISelLowering.cpp index 9d879886d39d..9c57926da5f5 100644 --- a/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -9347,11 +9347,20 @@ static SDValue replaceZeroVectorStore(SelectionDAG &DAG, StoreSDNode &St) { return SDValue(); } - // Use WZR/XZR here to prevent DAGCombiner::MergeConsecutiveStores from - // undoing this transformation. - SDValue SplatVal = VT.getVectorElementType().getSizeInBits() == 32 - ? DAG.getRegister(AArch64::WZR, MVT::i32) - : DAG.getRegister(AArch64::XZR, MVT::i64); + // Use a CopyFromReg WZR/XZR here to prevent + // DAGCombiner::MergeConsecutiveStores from undoing this transformation. + SDLoc DL(&St); + unsigned ZeroReg; + EVT ZeroVT; + if (VT.getVectorElementType().getSizeInBits() == 32) { + ZeroReg = AArch64::WZR; + ZeroVT = MVT::i32; + } else { + ZeroReg = AArch64::XZR; + ZeroVT = MVT::i64; + } + SDValue SplatVal = + DAG.getCopyFromReg(DAG.getEntryNode(), DL, ZeroReg, ZeroVT); return splitStoreSplat(DAG, St, SplatVal, NumVecElts); } diff --git a/lib/Target/AArch64/AArch64InstrInfo.cpp b/lib/Target/AArch64/AArch64InstrInfo.cpp index c0c6055c358f..13c80a46e5b0 100644 --- a/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -940,6 +940,12 @@ bool AArch64InstrInfo::areMemAccessesTriviallyDisjoint( bool AArch64InstrInfo::analyzeCompare(const MachineInstr &MI, unsigned &SrcReg, unsigned &SrcReg2, int &CmpMask, int &CmpValue) const { + // The first operand can be a frame index where we'd normally expect a + // register. + assert(MI.getNumOperands() >= 2 && "All AArch64 cmps should have 2 operands"); + if (!MI.getOperand(1).isReg()) + return false; + switch (MI.getOpcode()) { default: break; diff --git a/lib/Target/AArch64/AArch64InstrInfo.td b/lib/Target/AArch64/AArch64InstrInfo.td index 5049a39814f1..59719978a3a6 100644 --- a/lib/Target/AArch64/AArch64InstrInfo.td +++ b/lib/Target/AArch64/AArch64InstrInfo.td @@ -441,8 +441,7 @@ def MSRpstateImm1 : MSRpstateImm0_1; def MSRpstateImm4 : MSRpstateImm0_15; // The thread pointer (on Linux, at least, where this has been implemented) is -// TPIDR_EL0. Add pseudo op so we can mark it as not having any side effects. -let hasSideEffects = 0 in +// TPIDR_EL0. def MOVbaseTLS : Pseudo<(outs GPR64:$dst), (ins), [(set GPR64:$dst, AArch64threadpointer)]>, Sched<[WriteSys]>; diff --git a/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp b/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp index 4e65c0ab6011..22c11c7276d2 100644 --- a/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp +++ b/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp @@ -167,6 +167,9 @@ AArch64RedundantCopyElimination::knownRegValInBlock( // CMP is an alias for SUBS with a dead destination register. case AArch64::SUBSWri: case AArch64::SUBSXri: { + // Sometimes the first operand is a FrameIndex. Bail if tht happens. + if (!PredI.getOperand(1).isReg()) + return None; MCPhysReg SrcReg = PredI.getOperand(1).getReg(); // Must not be a symbolic immediate. diff --git a/lib/Target/AMDGPU/GCNHazardRecognizer.cpp b/lib/Target/AMDGPU/GCNHazardRecognizer.cpp index cd9e7fb04f16..025397b1eac0 100644 --- a/lib/Target/AMDGPU/GCNHazardRecognizer.cpp +++ b/lib/Target/AMDGPU/GCNHazardRecognizer.cpp @@ -218,12 +218,17 @@ void GCNHazardRecognizer::RecedeCycle() { int GCNHazardRecognizer::getWaitStatesSince( function_ref IsHazard) { - int WaitStates = -1; + int WaitStates = 0; for (MachineInstr *MI : EmittedInstrs) { + if (MI) { + if (IsHazard(MI)) + return WaitStates; + + unsigned Opcode = MI->getOpcode(); + if (Opcode == AMDGPU::DBG_VALUE || Opcode == AMDGPU::IMPLICIT_DEF) + continue; + } ++WaitStates; - if (!MI || !IsHazard(MI)) - continue; - return WaitStates; } return std::numeric_limits::max(); } diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 582153daebde..b24d3420d1d9 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -1276,6 +1276,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) { // Add 's' bit operand (always reg0 for this) .addReg(0)); + assert(Subtarget->hasV4TOps()); EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::BX) .addReg(MI->getOperand(0).getReg())); return; @@ -1896,6 +1897,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) { .addImm(ARMCC::AL) .addReg(0)); + assert(Subtarget->hasV4TOps()); EmitToStreamer(*OutStreamer, MCInstBuilder(ARM::BX) .addReg(ScratchReg) // Predicate. diff --git a/lib/Target/ARM/ARMCallLowering.cpp b/lib/Target/ARM/ARMCallLowering.cpp index 051827a6a6a2..a1a31e1e7fae 100644 --- a/lib/Target/ARM/ARMCallLowering.cpp +++ b/lib/Target/ARM/ARMCallLowering.cpp @@ -251,7 +251,9 @@ bool ARMCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, unsigned VReg) const { assert(!Val == !VReg && "Return value without a vreg"); - auto Ret = MIRBuilder.buildInstrNoInsert(ARM::BX_RET).add(predOps(ARMCC::AL)); + auto const &ST = MIRBuilder.getMF().getSubtarget(); + unsigned Opcode = ST.getReturnOpcode(); + auto Ret = MIRBuilder.buildInstrNoInsert(Opcode).add(predOps(ARMCC::AL)); if (!lowerReturnVal(MIRBuilder, Val, VReg, Ret)) return false; diff --git a/lib/Target/ARM/ARMExpandPseudoInsts.cpp b/lib/Target/ARM/ARMExpandPseudoInsts.cpp index 46d8f0dba691..376727729d89 100644 --- a/lib/Target/ARM/ARMExpandPseudoInsts.cpp +++ b/lib/Target/ARM/ARMExpandPseudoInsts.cpp @@ -1030,8 +1030,11 @@ bool ARMExpandPseudo::ExpandMI(MachineBasicBlock &MBB, if (STI->isThumb()) MIB.add(predOps(ARMCC::AL)); } else if (RetOpcode == ARM::TCRETURNri) { + unsigned Opcode = + STI->isThumb() ? ARM::tTAILJMPr + : (STI->hasV4TOps() ? ARM::TAILJMPr : ARM::TAILJMPr4); BuildMI(MBB, MBBI, dl, - TII.get(STI->isThumb() ? ARM::tTAILJMPr : ARM::TAILJMPr)) + TII.get(Opcode)) .addReg(JumpTarget.getReg(), RegState::Kill); } diff --git a/lib/Target/ARM/ARMFastISel.cpp b/lib/Target/ARM/ARMFastISel.cpp index bf00ef61c2d1..5dc93734ab59 100644 --- a/lib/Target/ARM/ARMFastISel.cpp +++ b/lib/Target/ARM/ARMFastISel.cpp @@ -1332,6 +1332,8 @@ bool ARMFastISel::SelectIndirectBr(const Instruction *I) { if (AddrReg == 0) return false; unsigned Opc = isThumb2 ? ARM::tBRIND : ARM::BX; + assert(isThumb2 || Subtarget->hasV4TOps()); + AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc)).addReg(AddrReg)); @@ -2168,9 +2170,8 @@ bool ARMFastISel::SelectRet(const Instruction *I) { RetRegs.push_back(VA.getLocReg()); } - unsigned RetOpc = isThumb2 ? ARM::tBX_RET : ARM::BX_RET; MachineInstrBuilder MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, - TII.get(RetOpc)); + TII.get(Subtarget->getReturnOpcode())); AddOptionalDefs(MIB); for (unsigned R : RetRegs) MIB.addReg(R, RegState::Implicit); diff --git a/lib/Target/ARM/ARMFrameLowering.cpp b/lib/Target/ARM/ARMFrameLowering.cpp index 16b54e8848c2..00b788a1b530 100644 --- a/lib/Target/ARM/ARMFrameLowering.cpp +++ b/lib/Target/ARM/ARMFrameLowering.cpp @@ -479,7 +479,7 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF, if (DPRCSSize > 0) { // Since vpush register list cannot have gaps, there may be multiple vpush // instructions in the prologue. - while (MBBI->getOpcode() == ARM::VSTMDDB_UPD) { + while (MBBI != MBB.end() && MBBI->getOpcode() == ARM::VSTMDDB_UPD) { DefCFAOffsetCandidates.addInst(MBBI, sizeOfSPAdjustment(*MBBI)); LastPush = MBBI++; } @@ -2397,9 +2397,8 @@ void ARMFrameLowering::adjustForSegmentedStacks( BuildMI(AllocMBB, DL, TII.get(TargetOpcode::CFI_INSTRUCTION)) .addCFIIndex(CFIIndex); - // bx lr - Return from this function. - Opcode = Thumb ? ARM::tBX_RET : ARM::BX_RET; - BuildMI(AllocMBB, DL, TII.get(Opcode)).add(predOps(ARMCC::AL)); + // Return from this function. + BuildMI(AllocMBB, DL, TII.get(ST->getReturnOpcode())).add(predOps(ARMCC::AL)); // Restore SR0 and SR1 in case of __morestack() was not called. // pop {SR0, SR1} diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td index 7206083a7079..c488cd347fe1 100644 --- a/lib/Target/ARM/ARMInstrInfo.td +++ b/lib/Target/ARM/ARMInstrInfo.td @@ -2425,7 +2425,7 @@ let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [SP] in { def TAILJMPr : ARMPseudoExpand<(outs), (ins tcGPR:$dst), 4, IIC_Br, [], (BX GPR:$dst)>, Sched<[WriteBr]>, - Requires<[IsARM]>; + Requires<[IsARM, HasV4T]>; } // Secure Monitor Call is a system instruction. @@ -5589,6 +5589,12 @@ let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in (MOVr PC, GPR:$dst, (ops 14, zero_reg), zero_reg)>, Requires<[IsARM, NoV4T]>, Sched<[WriteBr]>; +let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, Uses = [SP] in + def TAILJMPr4 : ARMPseudoExpand<(outs), (ins GPR:$dst), + 4, IIC_Br, [], + (MOVr PC, GPR:$dst, (ops 14, zero_reg), zero_reg)>, + Requires<[IsARM, NoV4T]>, Sched<[WriteBr]>; + // Large immediate handling. // 32-bit immediate using two piece mod_imms or movw + movt. diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index 7a452d4a2095..5d57b6803c08 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -1909,6 +1909,7 @@ bool ARMLoadStoreOpt::CombineMovBx(MachineBasicBlock &MBB) { for (auto Use : Prev->uses()) if (Use.isKill()) { + assert(STI->hasV4TOps()); BuildMI(MBB, MBBI, MBBI->getDebugLoc(), TII->get(ARM::tBX)) .addReg(Use.getReg(), RegState::Kill) .add(predOps(ARMCC::AL)) diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h index e15b17512c96..9d749537dc3b 100644 --- a/lib/Target/ARM/ARMSubtarget.h +++ b/lib/Target/ARM/ARMSubtarget.h @@ -729,6 +729,17 @@ class ARMSubtarget : public ARMGenSubtargetInfo { /// True if fast-isel is used. bool useFastISel() const; + + /// Returns the correct return opcode for the current feature set. + /// Use BX if available to allow mixing thumb/arm code, but fall back + /// to plain mov pc,lr on ARMv4. + unsigned getReturnOpcode() const { + if (isThumb()) + return ARM::tBX_RET; + if (hasV4TOps()) + return ARM::BX_RET; + return ARM::MOVPCLR; + } }; } // end namespace llvm diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp index b8a8b1f7619a..2ab7bfe4410b 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp @@ -142,9 +142,9 @@ std::string ARM_MC::ParseARMTriple(const Triple &TT, StringRef CPU) { if (isThumb) { if (ARMArchFeature.empty()) - ARMArchFeature = "+thumb-mode"; + ARMArchFeature = "+thumb-mode,+v4t"; else - ARMArchFeature += ",+thumb-mode"; + ARMArchFeature += ",+thumb-mode,+v4t"; } if (TT.isOSNaCl()) { diff --git a/lib/Target/AVR/AVRExpandPseudoInsts.cpp b/lib/Target/AVR/AVRExpandPseudoInsts.cpp index 540e05a92997..d6f85edae47c 100644 --- a/lib/Target/AVR/AVRExpandPseudoInsts.cpp +++ b/lib/Target/AVR/AVRExpandPseudoInsts.cpp @@ -583,8 +583,8 @@ bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { unsigned TmpReg = 0; // 0 for no temporary register unsigned SrcReg = MI.getOperand(1).getReg(); bool SrcIsKill = MI.getOperand(1).isKill(); - OpLo = AVR::LDRdPtr; - OpHi = AVR::LDDRdPtrQ; + OpLo = AVR::LDRdPtrPi; + OpHi = AVR::LDRdPtr; TRI->splitReg(DstReg, DstLoReg, DstHiReg); // Use a temporary register if src and dst registers are the same. @@ -597,6 +597,7 @@ bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { // Load low byte. auto MIBLO = buildMI(MBB, MBBI, OpLo) .addReg(CurDstLoReg, RegState::Define) + .addReg(SrcReg, RegState::Define) .addReg(SrcReg); // Push low byte onto stack if necessary. @@ -606,8 +607,7 @@ bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { // Load high byte. auto MIBHI = buildMI(MBB, MBBI, OpHi) .addReg(CurDstHiReg, RegState::Define) - .addReg(SrcReg, getKillRegState(SrcIsKill)) - .addImm(1); + .addReg(SrcReg, getKillRegState(SrcIsKill)); if (TmpReg) { // Move the high byte into the final destination. @@ -699,7 +699,9 @@ bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { OpHi = AVR::LDDRdPtrQ; TRI->splitReg(DstReg, DstLoReg, DstHiReg); - assert(Imm <= 63 && "Offset is out of range"); + // Since we add 1 to the Imm value for the high byte below, and 63 is the highest Imm value + // allowed for the instruction, 62 is the limit here. + assert(Imm <= 62 && "Offset is out of range"); // Use a temporary register if src and dst registers are the same. if (DstReg == SrcReg) @@ -741,7 +743,50 @@ bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { template <> bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { - llvm_unreachable("wide LPM is unimplemented"); + MachineInstr &MI = *MBBI; + unsigned OpLo, OpHi, DstLoReg, DstHiReg; + unsigned DstReg = MI.getOperand(0).getReg(); + unsigned TmpReg = 0; // 0 for no temporary register + unsigned SrcReg = MI.getOperand(1).getReg(); + bool SrcIsKill = MI.getOperand(1).isKill(); + OpLo = AVR::LPMRdZPi; + OpHi = AVR::LPMRdZ; + TRI->splitReg(DstReg, DstLoReg, DstHiReg); + + // Use a temporary register if src and dst registers are the same. + if (DstReg == SrcReg) + TmpReg = scavengeGPR8(MI); + + unsigned CurDstLoReg = (DstReg == SrcReg) ? TmpReg : DstLoReg; + unsigned CurDstHiReg = (DstReg == SrcReg) ? TmpReg : DstHiReg; + + // Load low byte. + auto MIBLO = buildMI(MBB, MBBI, OpLo) + .addReg(CurDstLoReg, RegState::Define) + .addReg(SrcReg); + + // Push low byte onto stack if necessary. + if (TmpReg) + buildMI(MBB, MBBI, AVR::PUSHRr).addReg(TmpReg); + + // Load high byte. + auto MIBHI = buildMI(MBB, MBBI, OpHi) + .addReg(CurDstHiReg, RegState::Define) + .addReg(SrcReg, getKillRegState(SrcIsKill)); + + if (TmpReg) { + // Move the high byte into the final destination. + buildMI(MBB, MBBI, AVR::MOVRdRr).addReg(DstHiReg).addReg(TmpReg); + + // Move the low byte from the scratch space into the final destination. + buildMI(MBB, MBBI, AVR::POPRd).addReg(DstLoReg); + } + + MIBLO->setMemRefs(MI.memoperands_begin(), MI.memoperands_end()); + MIBHI->setMemRefs(MI.memoperands_begin(), MI.memoperands_end()); + + MI.eraseFromParent(); + return true; } template <> @@ -1074,7 +1119,9 @@ bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { OpHi = AVR::STDPtrQRr; TRI->splitReg(SrcReg, SrcLoReg, SrcHiReg); - assert(Imm <= 63 && "Offset is out of range"); + // Since we add 1 to the Imm value for the high byte below, and 63 is the highest Imm value + // allowed for the instruction, 62 is the limit here. + assert(Imm <= 62 && "Offset is out of range"); auto MIBLO = buildMI(MBB, MBBI, OpLo) .addReg(DstReg) @@ -1104,7 +1151,9 @@ bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { OpHi = AVR::INRdA; TRI->splitReg(DstReg, DstLoReg, DstHiReg); - assert(Imm <= 63 && "Address is out of range"); + // Since we add 1 to the Imm value for the high byte below, and 63 is the highest Imm value + // allowed for the instruction, 62 is the limit here. + assert(Imm <= 62 && "Address is out of range"); auto MIBLO = buildMI(MBB, MBBI, OpLo) .addReg(DstLoReg, RegState::Define | getDeadRegState(DstIsDead)) @@ -1132,7 +1181,9 @@ bool AVRExpandPseudo::expand(Block &MBB, BlockIt MBBI) { OpHi = AVR::OUTARr; TRI->splitReg(SrcReg, SrcLoReg, SrcHiReg); - assert(Imm <= 63 && "Address is out of range"); + // Since we add 1 to the Imm value for the high byte below, and 63 is the highest Imm value + // allowed for the instruction, 62 is the limit here. + assert(Imm <= 62 && "Address is out of range"); // 16 bit I/O writes need the high byte first auto MIBHI = buildMI(MBB, MBBI, OpHi) diff --git a/lib/Target/AVR/AVRISelLowering.cpp b/lib/Target/AVR/AVRISelLowering.cpp index 7d3faac1dcc2..d8e8bc1ff554 100644 --- a/lib/Target/AVR/AVRISelLowering.cpp +++ b/lib/Target/AVR/AVRISelLowering.cpp @@ -1469,8 +1469,10 @@ MachineBasicBlock *AVRTargetLowering::insertShift(MachineInstr &MI, } const BasicBlock *LLVM_BB = BB->getBasicBlock(); - MachineFunction::iterator I = BB->getParent()->begin(); - ++I; + + MachineFunction::iterator I; + for (I = F->begin(); I != F->end() && &(*I) != BB; ++I); + if (I != F->end()) ++I; // Create loop block. MachineBasicBlock *LoopBB = F->CreateMachineBasicBlock(LLVM_BB); diff --git a/lib/Target/AVR/AVRISelLowering.h b/lib/Target/AVR/AVRISelLowering.h index b44c62a21ac3..85f9552cd75c 100644 --- a/lib/Target/AVR/AVRISelLowering.h +++ b/lib/Target/AVR/AVRISelLowering.h @@ -75,6 +75,11 @@ class AVRTargetLowering : public TargetLowering { MVT getScalarShiftAmountTy(const DataLayout &, EVT LHSTy) const override { return MVT::i8; } + + MVT::SimpleValueType getCmpLibcallReturnType() const override { + return MVT::i8; + } + const char *getTargetNodeName(unsigned Opcode) const override; SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override; diff --git a/lib/Target/AVR/AVRInstrInfo.cpp b/lib/Target/AVR/AVRInstrInfo.cpp index 744aa723c416..1a89a13693e1 100644 --- a/lib/Target/AVR/AVRInstrInfo.cpp +++ b/lib/Target/AVR/AVRInstrInfo.cpp @@ -537,8 +537,7 @@ bool AVRInstrInfo::isBranchOffsetInRange(unsigned BranchOp, llvm_unreachable("unexpected opcode!"); case AVR::JMPk: case AVR::CALLk: - assert(BrOffset >= 0 && "offset must be absolute address"); - return isUIntN(16, BrOffset); + return true; case AVR::RCALLk: case AVR::RJMPk: return isIntN(13, BrOffset); @@ -556,5 +555,20 @@ bool AVRInstrInfo::isBranchOffsetInRange(unsigned BranchOp, } } +unsigned AVRInstrInfo::insertIndirectBranch(MachineBasicBlock &MBB, + MachineBasicBlock &NewDestBB, + const DebugLoc &DL, + int64_t BrOffset, + RegScavenger *RS) const { + // This method inserts a *direct* branch (JMP), despite its name. + // LLVM calls this method to fixup unconditional branches; it never calls + // insertBranch or some hypothetical "insertDirectBranch". + // See lib/CodeGen/RegisterRelaxation.cpp for details. + // We end up here when a jump is too long for a RJMP instruction. + auto &MI = *BuildMI(&MBB, DL, get(AVR::JMPk)).addMBB(&NewDestBB); + + return getInstSizeInBytes(MI); +} + } // end of namespace llvm diff --git a/lib/Target/AVR/AVRInstrInfo.h b/lib/Target/AVR/AVRInstrInfo.h index f42d34fb2848..eee8a92c6191 100644 --- a/lib/Target/AVR/AVRInstrInfo.h +++ b/lib/Target/AVR/AVRInstrInfo.h @@ -107,6 +107,12 @@ class AVRInstrInfo : public AVRGenInstrInfo { bool isBranchOffsetInRange(unsigned BranchOpc, int64_t BrOffset) const override; + + unsigned insertIndirectBranch(MachineBasicBlock &MBB, + MachineBasicBlock &NewDestBB, + const DebugLoc &DL, + int64_t BrOffset, + RegScavenger *RS) const override; private: const AVRRegisterInfo RI; }; diff --git a/lib/Target/AVR/AVRInstrInfo.td b/lib/Target/AVR/AVRInstrInfo.td index 184e4d53f7c8..7d1bfc8d85e0 100644 --- a/lib/Target/AVR/AVRInstrInfo.td +++ b/lib/Target/AVR/AVRInstrInfo.td @@ -1152,10 +1152,10 @@ isReMaterializable = 1 in // // Expands to: // ld Rd, P+ - // ld Rd+1, P+ + // ld Rd+1, P let Constraints = "@earlyclobber $reg" in def LDWRdPtr : Pseudo<(outs DREGS:$reg), - (ins PTRDISPREGS:$ptrreg), + (ins PTRREGS:$ptrreg), "ldw\t$reg, $ptrreg", [(set i16:$reg, (load i16:$ptrreg))]>, Requires<[HasSRAM]>; @@ -1164,7 +1164,7 @@ isReMaterializable = 1 in // Indirect loads (with postincrement or predecrement). let mayLoad = 1, hasSideEffects = 0, -Constraints = "$ptrreg = $base_wb,@earlyclobber $reg,@earlyclobber $base_wb" in +Constraints = "$ptrreg = $base_wb,@earlyclobber $reg" in { def LDRdPtrPi : FSTLD<0, 0b01, @@ -1238,35 +1238,55 @@ isReMaterializable = 1 in Requires<[HasSRAM]>; } -class AtomicLoad : - Pseudo<(outs DRC:$rd), (ins PTRREGS:$rr), "atomic_op", +class AtomicLoad : + Pseudo<(outs DRC:$rd), (ins PTRRC:$rr), "atomic_op", [(set DRC:$rd, (Op i16:$rr))]>; -class AtomicStore : - Pseudo<(outs), (ins PTRDISPREGS:$rd, DRC:$rr), "atomic_op", +class AtomicStore : + Pseudo<(outs), (ins PTRRC:$rd, DRC:$rr), "atomic_op", [(Op i16:$rd, DRC:$rr)]>; -class AtomicLoadOp : - Pseudo<(outs DRC:$rd), (ins PTRREGS:$rr, DRC:$operand), +class AtomicLoadOp : + Pseudo<(outs DRC:$rd), (ins PTRRC:$rr, DRC:$operand), "atomic_op", [(set DRC:$rd, (Op i16:$rr, DRC:$operand))]>; -def AtomicLoad8 : AtomicLoad; -def AtomicLoad16 : AtomicLoad; +// FIXME: I think 16-bit atomic binary ops need to mark +// r0 as clobbered. -def AtomicStore8 : AtomicStore; -def AtomicStore16 : AtomicStore; +// Atomic instructions +// =================== +// +// These are all expanded by AVRExpandPseudoInsts +// +// 8-bit operations can use any pointer register because +// they are expanded directly into an LD/ST instruction. +// +// 16-bit operations use 16-bit load/store postincrement instructions, +// which require PTRDISPREGS. -def AtomicLoadAdd8 : AtomicLoadOp; -def AtomicLoadAdd16 : AtomicLoadOp; -def AtomicLoadSub8 : AtomicLoadOp; -def AtomicLoadSub16 : AtomicLoadOp; -def AtomicLoadAnd8 : AtomicLoadOp; -def AtomicLoadAnd16 : AtomicLoadOp; -def AtomicLoadOr8 : AtomicLoadOp; -def AtomicLoadOr16 : AtomicLoadOp; -def AtomicLoadXor8 : AtomicLoadOp; -def AtomicLoadXor16 : AtomicLoadOp; +def AtomicLoad8 : AtomicLoad; +def AtomicLoad16 : AtomicLoad; + +def AtomicStore8 : AtomicStore; +def AtomicStore16 : AtomicStore; + +class AtomicLoadOp8 : AtomicLoadOp; +class AtomicLoadOp16 : AtomicLoadOp; + +def AtomicLoadAdd8 : AtomicLoadOp8; +def AtomicLoadAdd16 : AtomicLoadOp16; +def AtomicLoadSub8 : AtomicLoadOp8; +def AtomicLoadSub16 : AtomicLoadOp16; +def AtomicLoadAnd8 : AtomicLoadOp8; +def AtomicLoadAnd16 : AtomicLoadOp16; +def AtomicLoadOr8 : AtomicLoadOp8; +def AtomicLoadOr16 : AtomicLoadOp16; +def AtomicLoadXor8 : AtomicLoadOp8; +def AtomicLoadXor16 : AtomicLoadOp16; def AtomicFence : Pseudo<(outs), (ins), "atomic_fence", [(atomic_fence imm, imm)]>; @@ -1397,6 +1417,7 @@ def STDWPtrQRr : Pseudo<(outs), // Load program memory operations. let canFoldAsLoad = 1, isReMaterializable = 1, +mayLoad = 1, hasSideEffects = 0 in { let Defs = [R0], @@ -1417,8 +1438,7 @@ hasSideEffects = 0 in Requires<[HasLPMX]>; // Load program memory, while postincrementing the Z register. - let mayLoad = 1, - Defs = [R31R30] in + let Defs = [R31R30] in { def LPMRdZPi : FLPMX<0, 1, diff --git a/lib/Target/AVR/AVRRegisterInfo.cpp b/lib/Target/AVR/AVRRegisterInfo.cpp index 249dc5512c28..7099b29a8bcd 100644 --- a/lib/Target/AVR/AVRRegisterInfo.cpp +++ b/lib/Target/AVR/AVRRegisterInfo.cpp @@ -203,7 +203,7 @@ void AVRRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, // If the offset is too big we have to adjust and restore the frame pointer // to materialize a valid load/store with displacement. //:TODO: consider using only one adiw/sbiw chain for more than one frame index - if (Offset > 63) { + if (Offset > 62) { unsigned AddOpc = AVR::ADIWRdK, SubOpc = AVR::SBIWRdK; int AddOffset = Offset - 63 + 1; diff --git a/lib/Target/AVR/AVRTargetMachine.cpp b/lib/Target/AVR/AVRTargetMachine.cpp index a9d61ffc952c..e698b6e694cf 100644 --- a/lib/Target/AVR/AVRTargetMachine.cpp +++ b/lib/Target/AVR/AVRTargetMachine.cpp @@ -25,7 +25,7 @@ namespace llvm { -static const char *AVRDataLayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-n8"; +static const char *AVRDataLayout = "e-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"; /// Processes a CPU name. static StringRef getCPU(StringRef CPU) { diff --git a/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.cpp b/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.cpp index a2d8c16eeb8c..2b45d9adc7e9 100644 --- a/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.cpp +++ b/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.cpp @@ -13,6 +13,8 @@ #include "AVRTargetStreamer.h" +#include "llvm/MC/MCContext.h" + namespace llvm { AVRTargetStreamer::AVRTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {} @@ -20,5 +22,23 @@ AVRTargetStreamer::AVRTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {} AVRTargetAsmStreamer::AVRTargetAsmStreamer(MCStreamer &S) : AVRTargetStreamer(S) {} +void AVRTargetStreamer::finish() { + MCStreamer &OS = getStreamer(); + MCContext &Context = OS.getContext(); + + MCSymbol *DoCopyData = Context.getOrCreateSymbol("__do_copy_data"); + MCSymbol *DoClearBss = Context.getOrCreateSymbol("__do_clear_bss"); + + // FIXME: We can disable __do_copy_data if there are no static RAM variables. + + OS.emitRawComment(" Declaring this symbol tells the CRT that it should"); + OS.emitRawComment("copy all variables from program memory to RAM on startup"); + OS.EmitSymbolAttribute(DoCopyData, MCSA_Global); + + OS.emitRawComment(" Declaring this symbol tells the CRT that it should"); + OS.emitRawComment("clear the zeroed data section on startup"); + OS.EmitSymbolAttribute(DoClearBss, MCSA_Global); +} + } // end namespace llvm diff --git a/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.h b/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.h index 99a536699ae9..815088b0a5de 100644 --- a/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.h +++ b/lib/Target/AVR/MCTargetDesc/AVRTargetStreamer.h @@ -19,6 +19,8 @@ class MCStreamer; class AVRTargetStreamer : public MCTargetStreamer { public: explicit AVRTargetStreamer(MCStreamer &S); + + void finish() override; }; /// A target streamer for textual AVR assembly code. diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index e12188e70602..a294004b9f68 100644 --- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -304,6 +304,9 @@ class MipsAsmParser : public MCTargetAsmParser { bool expandSeqI(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out, const MCSubtargetInfo *STI); + bool expandMXTRAlias(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out, + const MCSubtargetInfo *STI); + bool reportParseError(Twine ErrorMsg); bool reportParseError(SMLoc Loc, Twine ErrorMsg); @@ -2511,6 +2514,16 @@ MipsAsmParser::tryExpandInstruction(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out, return expandSeq(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success; case Mips::SEQIMacro: return expandSeqI(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success; + case Mips::MFTC0: case Mips::MTTC0: + case Mips::MFTGPR: case Mips::MTTGPR: + case Mips::MFTLO: case Mips::MTTLO: + case Mips::MFTHI: case Mips::MTTHI: + case Mips::MFTACX: case Mips::MTTACX: + case Mips::MFTDSP: case Mips::MTTDSP: + case Mips::MFTC1: case Mips::MTTC1: + case Mips::MFTHC1: case Mips::MTTHC1: + case Mips::CFTC1: case Mips::CTTC1: + return expandMXTRAlias(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success; } } @@ -4882,6 +4895,212 @@ bool MipsAsmParser::expandSeqI(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out, return false; } +// Map the DSP accumulator and control register to the corresponding gpr +// operand. Unlike the other alias, the m(f|t)t(lo|hi|acx) instructions +// do not map the DSP registers contigously to gpr registers. +static unsigned getRegisterForMxtrDSP(MCInst &Inst, bool IsMFDSP) { + switch (Inst.getOpcode()) { + case Mips::MFTLO: + case Mips::MTTLO: + switch (Inst.getOperand(IsMFDSP ? 1 : 0).getReg()) { + case Mips::AC0: + return Mips::ZERO; + case Mips::AC1: + return Mips::A0; + case Mips::AC2: + return Mips::T0; + case Mips::AC3: + return Mips::T4; + default: + llvm_unreachable("Unknown register for 'mttr' alias!"); + } + case Mips::MFTHI: + case Mips::MTTHI: + switch (Inst.getOperand(IsMFDSP ? 1 : 0).getReg()) { + case Mips::AC0: + return Mips::AT; + case Mips::AC1: + return Mips::A1; + case Mips::AC2: + return Mips::T1; + case Mips::AC3: + return Mips::T5; + default: + llvm_unreachable("Unknown register for 'mttr' alias!"); + } + case Mips::MFTACX: + case Mips::MTTACX: + switch (Inst.getOperand(IsMFDSP ? 1 : 0).getReg()) { + case Mips::AC0: + return Mips::V0; + case Mips::AC1: + return Mips::A2; + case Mips::AC2: + return Mips::T2; + case Mips::AC3: + return Mips::T6; + default: + llvm_unreachable("Unknown register for 'mttr' alias!"); + } + case Mips::MFTDSP: + case Mips::MTTDSP: + return Mips::S0; + default: + llvm_unreachable("Unknown instruction for 'mttr' dsp alias!"); + } +} + +// Map the floating point register operand to the corresponding register +// operand. +static unsigned getRegisterForMxtrFP(MCInst &Inst, bool IsMFTC1) { + switch (Inst.getOperand(IsMFTC1 ? 1 : 0).getReg()) { + case Mips::F0: return Mips::ZERO; + case Mips::F1: return Mips::AT; + case Mips::F2: return Mips::V0; + case Mips::F3: return Mips::V1; + case Mips::F4: return Mips::A0; + case Mips::F5: return Mips::A1; + case Mips::F6: return Mips::A2; + case Mips::F7: return Mips::A3; + case Mips::F8: return Mips::T0; + case Mips::F9: return Mips::T1; + case Mips::F10: return Mips::T2; + case Mips::F11: return Mips::T3; + case Mips::F12: return Mips::T4; + case Mips::F13: return Mips::T5; + case Mips::F14: return Mips::T6; + case Mips::F15: return Mips::T7; + case Mips::F16: return Mips::S0; + case Mips::F17: return Mips::S1; + case Mips::F18: return Mips::S2; + case Mips::F19: return Mips::S3; + case Mips::F20: return Mips::S4; + case Mips::F21: return Mips::S5; + case Mips::F22: return Mips::S6; + case Mips::F23: return Mips::S7; + case Mips::F24: return Mips::T8; + case Mips::F25: return Mips::T9; + case Mips::F26: return Mips::K0; + case Mips::F27: return Mips::K1; + case Mips::F28: return Mips::GP; + case Mips::F29: return Mips::SP; + case Mips::F30: return Mips::FP; + case Mips::F31: return Mips::RA; + default: llvm_unreachable("Unknown register for mttc1 alias!"); + } +} + +// Map the coprocessor operand the corresponding gpr register operand. +static unsigned getRegisterForMxtrC0(MCInst &Inst, bool IsMFTC0) { + switch (Inst.getOperand(IsMFTC0 ? 1 : 0).getReg()) { + case Mips::COP00: return Mips::ZERO; + case Mips::COP01: return Mips::AT; + case Mips::COP02: return Mips::V0; + case Mips::COP03: return Mips::V1; + case Mips::COP04: return Mips::A0; + case Mips::COP05: return Mips::A1; + case Mips::COP06: return Mips::A2; + case Mips::COP07: return Mips::A3; + case Mips::COP08: return Mips::T0; + case Mips::COP09: return Mips::T1; + case Mips::COP010: return Mips::T2; + case Mips::COP011: return Mips::T3; + case Mips::COP012: return Mips::T4; + case Mips::COP013: return Mips::T5; + case Mips::COP014: return Mips::T6; + case Mips::COP015: return Mips::T7; + case Mips::COP016: return Mips::S0; + case Mips::COP017: return Mips::S1; + case Mips::COP018: return Mips::S2; + case Mips::COP019: return Mips::S3; + case Mips::COP020: return Mips::S4; + case Mips::COP021: return Mips::S5; + case Mips::COP022: return Mips::S6; + case Mips::COP023: return Mips::S7; + case Mips::COP024: return Mips::T8; + case Mips::COP025: return Mips::T9; + case Mips::COP026: return Mips::K0; + case Mips::COP027: return Mips::K1; + case Mips::COP028: return Mips::GP; + case Mips::COP029: return Mips::SP; + case Mips::COP030: return Mips::FP; + case Mips::COP031: return Mips::RA; + default: llvm_unreachable("Unknown register for mttc0 alias!"); + } +} + +/// Expand an alias of 'mftr' or 'mttr' into the full instruction, by producing +/// an mftr or mttr with the correctly mapped gpr register, u, sel and h bits. +bool MipsAsmParser::expandMXTRAlias(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out, + const MCSubtargetInfo *STI) { + MipsTargetStreamer &TOut = getTargetStreamer(); + unsigned rd = 0; + unsigned u = 1; + unsigned sel = 0; + unsigned h = 0; + bool IsMFTR = false; + switch (Inst.getOpcode()) { + case Mips::MFTC0: + IsMFTR = true; + LLVM_FALLTHROUGH; + case Mips::MTTC0: + u = 0; + rd = getRegisterForMxtrC0(Inst, IsMFTR); + sel = Inst.getOperand(2).getImm(); + break; + case Mips::MFTGPR: + IsMFTR = true; + LLVM_FALLTHROUGH; + case Mips::MTTGPR: + rd = Inst.getOperand(IsMFTR ? 1 : 0).getReg(); + break; + case Mips::MFTLO: + case Mips::MFTHI: + case Mips::MFTACX: + case Mips::MFTDSP: + IsMFTR = true; + LLVM_FALLTHROUGH; + case Mips::MTTLO: + case Mips::MTTHI: + case Mips::MTTACX: + case Mips::MTTDSP: + rd = getRegisterForMxtrDSP(Inst, IsMFTR); + sel = 1; + break; + case Mips::MFTHC1: + h = 1; + LLVM_FALLTHROUGH; + case Mips::MFTC1: + IsMFTR = true; + rd = getRegisterForMxtrFP(Inst, IsMFTR); + sel = 2; + break; + case Mips::MTTHC1: + h = 1; + LLVM_FALLTHROUGH; + case Mips::MTTC1: + rd = getRegisterForMxtrFP(Inst, IsMFTR); + sel = 2; + break; + case Mips::CFTC1: + IsMFTR = true; + LLVM_FALLTHROUGH; + case Mips::CTTC1: + rd = getRegisterForMxtrFP(Inst, IsMFTR); + sel = 3; + break; + } + unsigned Op0 = IsMFTR ? Inst.getOperand(0).getReg() : rd; + unsigned Op1 = + IsMFTR ? rd + : (Inst.getOpcode() != Mips::MTTDSP ? Inst.getOperand(1).getReg() + : Inst.getOperand(0).getReg()); + + TOut.emitRRIII(IsMFTR ? Mips::MFTR : Mips::MTTR, Op0, Op1, u, sel, h, IDLoc, + STI); + return false; +} + unsigned MipsAsmParser::checkEarlyTargetMatchPredicate(MCInst &Inst, const OperandVector &Operands) { @@ -5793,14 +6012,21 @@ OperandMatchResultTy MipsAsmParser::parseInvNum(OperandVector &Operands) { MCAsmParser &Parser = getParser(); const MCExpr *IdVal; - // If the first token is '$' we may have register operand. - if (Parser.getTok().is(AsmToken::Dollar)) - return MatchOperand_NoMatch; + // If the first token is '$' we may have register operand. We have to reject + // cases where it is not a register. Complicating the matter is that + // register names are not reserved across all ABIs. + // Peek past the dollar to see if it's a register name for this ABI. SMLoc S = Parser.getTok().getLoc(); + if (Parser.getTok().is(AsmToken::Dollar)) { + return matchCPURegisterName(Parser.getLexer().peekTok().getString()) == -1 + ? MatchOperand_ParseFail + : MatchOperand_NoMatch; + } if (getParser().parseExpression(IdVal)) return MatchOperand_ParseFail; const MCConstantExpr *MCE = dyn_cast(IdVal); - assert(MCE && "Unexpected MCExpr type."); + if (!MCE) + return MatchOperand_NoMatch; int64_t Val = MCE->getValue(); SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1); Operands.push_back(MipsOperand::CreateImm( diff --git a/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp b/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp index aad6bf378ea0..0bddba781453 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp @@ -246,8 +246,6 @@ void MipsMCExpr::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const { break; case MEK_CALL_HI16: case MEK_CALL_LO16: - case MEK_DTPREL_HI: - case MEK_DTPREL_LO: case MEK_GOT: case MEK_GOT_CALL: case MEK_GOT_DISP: @@ -263,14 +261,16 @@ void MipsMCExpr::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const { case MEK_NEG: case MEK_PCREL_HI16: case MEK_PCREL_LO16: - case MEK_TLSLDM: // If we do have nested target-specific expressions, they will be in // a consecutive chain. if (const MipsMCExpr *E = dyn_cast(getSubExpr())) E->fixELFSymbolsInTLSFixups(Asm); break; - case MEK_GOTTPREL: + case MEK_DTPREL_HI: + case MEK_DTPREL_LO: + case MEK_TLSLDM: case MEK_TLSGD: + case MEK_GOTTPREL: case MEK_TPREL_HI: case MEK_TPREL_LO: fixELFSymbolsInTLSFixupsImpl(getSubExpr(), Asm); diff --git a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index 2907b7715857..7caeb08589af 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -193,6 +193,21 @@ void MipsTargetStreamer::emitRRI(unsigned Opcode, unsigned Reg0, unsigned Reg1, emitRRX(Opcode, Reg0, Reg1, MCOperand::createImm(Imm), IDLoc, STI); } +void MipsTargetStreamer::emitRRIII(unsigned Opcode, unsigned Reg0, + unsigned Reg1, int16_t Imm0, int16_t Imm1, + int16_t Imm2, SMLoc IDLoc, + const MCSubtargetInfo *STI) { + MCInst TmpInst; + TmpInst.setOpcode(Opcode); + TmpInst.addOperand(MCOperand::createReg(Reg0)); + TmpInst.addOperand(MCOperand::createReg(Reg1)); + TmpInst.addOperand(MCOperand::createImm(Imm0)); + TmpInst.addOperand(MCOperand::createImm(Imm1)); + TmpInst.addOperand(MCOperand::createImm(Imm2)); + TmpInst.setLoc(IDLoc); + getStreamer().EmitInstruction(TmpInst, *STI); +} + void MipsTargetStreamer::emitAddu(unsigned DstReg, unsigned SrcReg, unsigned TrgReg, bool Is64Bit, const MCSubtargetInfo *STI) { diff --git a/lib/Target/Mips/MicroMipsDSPInstrInfo.td b/lib/Target/Mips/MicroMipsDSPInstrInfo.td index f82f82fc7e45..20c1ab5a9998 100644 --- a/lib/Target/Mips/MicroMipsDSPInstrInfo.td +++ b/lib/Target/Mips/MicroMipsDSPInstrInfo.td @@ -415,6 +415,13 @@ class BITREV_MM_DESC : ABSQ_S_PH_MM_R2_DESC_BASE<"bitrev", int_mips_bitrev, class BPOSGE32_MM_DESC : BPOSGE32_DESC_BASE<"bposge32", brtarget_mm, NoItinerary>; +let DecoderNamespace = "MicroMipsDSP", Arch = "mmdsp", + AdditionalPredicates = [HasDSP, InMicroMips] in { + def LWDSP_MM : Load<"lw", DSPROpnd, null_frag, II_LW>, DspMMRel, + LW_FM_MM<0x3f>; + def SWDSP_MM : Store<"sw", DSPROpnd, null_frag, II_SW>, DspMMRel, + LW_FM_MM<0x3e>; +} // Instruction defs. // microMIPS DSP Rev 1 def ADDQ_PH_MM : DspMMRel, ADDQ_PH_MM_ENC, ADDQ_PH_DESC; diff --git a/lib/Target/Mips/MipsDSPInstrInfo.td b/lib/Target/Mips/MipsDSPInstrInfo.td index c238a65378e2..2595333188a4 100644 --- a/lib/Target/Mips/MipsDSPInstrInfo.td +++ b/lib/Target/Mips/MipsDSPInstrInfo.td @@ -1284,6 +1284,12 @@ let isPseudo = 1, isCodeGenOnly = 1, hasNoSchedulingInfo = 1 in { def STORE_CCOND_DSP : Store<"store_ccond_dsp", DSPCC>; } +let DecoderNamespace = "MipsDSP", Arch = "dsp", + AdditionalPredicates = [HasDSP] in { + def LWDSP : Load<"lw", DSPROpnd, null_frag, II_LW>, DspMMRel, LW_FM<0x23>; + def SWDSP : Store<"sw", DSPROpnd, null_frag, II_SW>, DspMMRel, LW_FM<0x2b>; +} + // Pseudo CMP and PICK instructions. class PseudoCMP : PseudoDSP<(outs DSPCC:$cmp), (ins DSPROpnd:$rs, DSPROpnd:$rt), []>, diff --git a/lib/Target/Mips/MipsFrameLowering.cpp b/lib/Target/Mips/MipsFrameLowering.cpp index ef05166503b2..27a85970da6f 100644 --- a/lib/Target/Mips/MipsFrameLowering.cpp +++ b/lib/Target/Mips/MipsFrameLowering.cpp @@ -107,38 +107,31 @@ bool MipsFrameLowering::hasBP(const MachineFunction &MF) const { return MFI.hasVarSizedObjects() && TRI->needsStackRealignment(MF); } +// Estimate the size of the stack, including the incoming arguments. We need to +// account for register spills, local objects, reserved call frame and incoming +// arguments. This is required to determine the largest possible positive offset +// from $sp so that it can be determined if an emergency spill slot for stack +// addresses is required. uint64_t MipsFrameLowering::estimateStackSize(const MachineFunction &MF) const { const MachineFrameInfo &MFI = MF.getFrameInfo(); const TargetRegisterInfo &TRI = *STI.getRegisterInfo(); - int64_t Offset = 0; + int64_t Size = 0; - // Iterate over fixed sized objects. + // Iterate over fixed sized objects which are incoming arguments. for (int I = MFI.getObjectIndexBegin(); I != 0; ++I) - Offset = std::max(Offset, -MFI.getObjectOffset(I)); + if (MFI.getObjectOffset(I) > 0) + Size += MFI.getObjectSize(I); // Conservatively assume all callee-saved registers will be saved. for (const MCPhysReg *R = TRI.getCalleeSavedRegs(&MF); *R; ++R) { - unsigned Size = TRI.getSpillSize(*TRI.getMinimalPhysRegClass(*R)); - Offset = alignTo(Offset + Size, Size); + unsigned RegSize = TRI.getSpillSize(*TRI.getMinimalPhysRegClass(*R)); + Size = alignTo(Size + RegSize, RegSize); } - unsigned MaxAlign = MFI.getMaxAlignment(); - - // Check that MaxAlign is not zero if there is a stack object that is not a - // callee-saved spill. - assert(!MFI.getObjectIndexEnd() || MaxAlign); - - // Iterate over other objects. - for (unsigned I = 0, E = MFI.getObjectIndexEnd(); I != E; ++I) - Offset = alignTo(Offset + MFI.getObjectSize(I), MaxAlign); - - // Call frame. - if (MFI.adjustsStack() && hasReservedCallFrame(MF)) - Offset = alignTo(Offset + MFI.getMaxCallFrameSize(), - std::max(MaxAlign, getStackAlignment())); - - return alignTo(Offset, getStackAlignment()); + // Get the size of the rest of the frame objects and any possible reserved + // call frame, accounting for alignment. + return Size + MFI.estimateStackSize(MF); } // Eliminate ADJCALLSTACKDOWN, ADJCALLSTACKUP pseudo instructions diff --git a/lib/Target/Mips/MipsMTInstrFormats.td b/lib/Target/Mips/MipsMTInstrFormats.td index 64bee5bfba18..edc0981e6278 100644 --- a/lib/Target/Mips/MipsMTInstrFormats.td +++ b/lib/Target/Mips/MipsMTInstrFormats.td @@ -35,6 +35,8 @@ class FIELD5 Val> { def FIELD5_1_DMT_EMT : FIELD5<0b00001>; def FIELD5_2_DMT_EMT : FIELD5<0b01111>; def FIELD5_1_2_DVPE_EVPE : FIELD5<0b00000>; +def FIELD5_MFTR : FIELD5<0b01000>; +def FIELD5_MTTR : FIELD5<0b01100>; class COP0_MFMC0_MT : MipsMTInst { bits<32> Inst; @@ -50,6 +52,25 @@ class COP0_MFMC0_MT : MipsMTInst { let Inst{2-0} = 0b001; } +class COP0_MFTTR_MT : MipsMTInst { + bits<32> Inst; + + bits<5> rt; + bits<5> rd; + bits<1> u; + bits<1> h; + bits<3> sel; + let Inst{31-26} = 0b010000; // COP0 + let Inst{25-21} = Op.Value; // MFMC0 + let Inst{20-16} = rt; + let Inst{15-11} = rd; + let Inst{10-6} = 0b00000; // rx - currently unsupported. + let Inst{5} = u; + let Inst{4} = h; + let Inst{3} = 0b0; + let Inst{2-0} = sel; +} + class SPECIAL3_MT_FORK : MipsMTInst { bits<32> Inst; diff --git a/lib/Target/Mips/MipsMTInstrInfo.td b/lib/Target/Mips/MipsMTInstrInfo.td index ab6693f60fd9..72e626cbec40 100644 --- a/lib/Target/Mips/MipsMTInstrInfo.td +++ b/lib/Target/Mips/MipsMTInstrInfo.td @@ -6,6 +6,13 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// This file describes the MIPS MT ASE as defined by MD00378 1.12. +// +// TODO: Add support for the microMIPS encodings for the MT ASE and add the +// instruction mappings. +// +//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// // MIPS MT Instruction Encodings @@ -27,6 +34,10 @@ class FORK_ENC : SPECIAL3_MT_FORK; class YIELD_ENC : SPECIAL3_MT_YIELD; +class MFTR_ENC : COP0_MFTTR_MT; + +class MTTR_ENC : COP0_MFTTR_MT; + //===----------------------------------------------------------------------===// // MIPS MT Instruction Descriptions //===----------------------------------------------------------------------===// @@ -39,6 +50,22 @@ class MT_1R_DESC_BASE { InstrItinClass Itinerary = Itin; } +class MFTR_DESC { + dag OutOperandList = (outs GPR32Opnd:$rd); + dag InOperandList = (ins GPR32Opnd:$rt, uimm1:$u, uimm3:$sel, uimm1:$h); + string AsmString = "mftr\t$rd, $rt, $u, $sel, $h"; + list Pattern = []; + InstrItinClass Itinerary = II_MFTR; +} + +class MTTR_DESC { + dag OutOperandList = (outs GPR32Opnd:$rd); + dag InOperandList = (ins GPR32Opnd:$rt, uimm1:$u, uimm3:$sel, uimm1:$h); + string AsmString = "mttr\t$rt, $rd, $u, $sel, $h"; + list Pattern = []; + InstrItinClass Itinerary = II_MTTR; +} + class FORK_DESC { dag OutOperandList = (outs GPR32Opnd:$rs, GPR32Opnd:$rd); dag InOperandList = (ins GPR32Opnd:$rt); @@ -79,8 +106,73 @@ let hasSideEffects = 1, isNotDuplicable = 1, def FORK : FORK_ENC, FORK_DESC, ASE_MT; def YIELD : YIELD_ENC, YIELD_DESC, ASE_MT; + + def MFTR : MFTR_ENC, MFTR_DESC, ASE_MT; + + def MTTR : MTTR_ENC, MTTR_DESC, ASE_MT; } +//===----------------------------------------------------------------------===// +// MIPS MT Pseudo Instructions - used to support mtfr & mttr aliases. +//===----------------------------------------------------------------------===// +def MFTC0 : MipsAsmPseudoInst<(outs GPR32Opnd:$rd), (ins COP0Opnd:$rt, + uimm3:$sel), + "mftc0 $rd, $rt, $sel">, ASE_MT; + +def MFTGPR : MipsAsmPseudoInst<(outs GPR32Opnd:$rd), (ins GPR32Opnd:$rt, + uimm3:$sel), + "mftgpr $rd, $rt">, ASE_MT; + +def MFTLO : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins ACC64DSPOpnd:$ac), + "mftlo $rt, $ac">, ASE_MT; + +def MFTHI : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins ACC64DSPOpnd:$ac), + "mfthi $rt, $ac">, ASE_MT; + +def MFTACX : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins ACC64DSPOpnd:$ac), + "mftacx $rt, $ac">, ASE_MT; + +def MFTDSP : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins), + "mftdsp $rt">, ASE_MT; + +def MFTC1 : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins FGR32Opnd:$ft), + "mftc1 $rt, $ft">, ASE_MT; + +def MFTHC1 : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins FGR32Opnd:$ft), + "mfthc1 $rt, $ft">, ASE_MT; + +def CFTC1 : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins FGRCCOpnd:$ft), + "cftc1 $rt, $ft">, ASE_MT; + + +def MTTC0 : MipsAsmPseudoInst<(outs COP0Opnd:$rd), (ins GPR32Opnd:$rt, + uimm3:$sel), + "mttc0 $rt, $rd, $sel">, ASE_MT; + +def MTTGPR : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins GPR32Opnd:$rd), + "mttgpr $rd, $rt">, ASE_MT; + +def MTTLO : MipsAsmPseudoInst<(outs ACC64DSPOpnd:$ac), (ins GPR32Opnd:$rt), + "mttlo $rt, $ac">, ASE_MT; + +def MTTHI : MipsAsmPseudoInst<(outs ACC64DSPOpnd:$ac), (ins GPR32Opnd:$rt), + "mtthi $rt, $ac">, ASE_MT; + +def MTTACX : MipsAsmPseudoInst<(outs ACC64DSPOpnd:$ac), (ins GPR32Opnd:$rt), + "mttacx $rt, $ac">, ASE_MT; + +def MTTDSP : MipsAsmPseudoInst<(outs), (ins GPR32Opnd:$rt), + "mttdsp $rt">, ASE_MT; + +def MTTC1 : MipsAsmPseudoInst<(outs FGR32Opnd:$ft), (ins GPR32Opnd:$rt), + "mttc1 $rt, $ft">, ASE_MT; + +def MTTHC1 : MipsAsmPseudoInst<(outs FGR32Opnd:$ft), (ins GPR32Opnd:$rt), + "mtthc1 $rt, $ft">, ASE_MT; + +def CTTC1 : MipsAsmPseudoInst<(outs FGRCCOpnd:$ft), (ins GPR32Opnd:$rt), + "cttc1 $rt, $ft">, ASE_MT; + //===----------------------------------------------------------------------===// // MIPS MT Instruction Definitions //===----------------------------------------------------------------------===// @@ -95,4 +187,22 @@ let AdditionalPredicates = [NotInMicroMips] in { def : MipsInstAlias<"evpe", (EVPE ZERO), 1>, ASE_MT; def : MipsInstAlias<"yield $rs", (YIELD ZERO, GPR32Opnd:$rs), 1>, ASE_MT; + + def : MipsInstAlias<"mftc0 $rd, $rt", (MFTC0 GPR32Opnd:$rd, COP0Opnd:$rt, 0), + 1>, ASE_MT; + + def : MipsInstAlias<"mftlo $rt", (MFTLO GPR32Opnd:$rt, AC0), 1>, ASE_MT; + + def : MipsInstAlias<"mfthi $rt", (MFTHI GPR32Opnd:$rt, AC0), 1>, ASE_MT; + + def : MipsInstAlias<"mftacx $rt", (MFTACX GPR32Opnd:$rt, AC0), 1>, ASE_MT; + + def : MipsInstAlias<"mttc0 $rd, $rt", (MTTC0 COP0Opnd:$rt, GPR32Opnd:$rd, 0), + 1>, ASE_MT; + + def : MipsInstAlias<"mttlo $rt", (MTTLO AC0, GPR32Opnd:$rt), 1>, ASE_MT; + + def : MipsInstAlias<"mtthi $rt", (MTTHI AC0, GPR32Opnd:$rt), 1>, ASE_MT; + + def : MipsInstAlias<"mttacx $rt", (MTTACX AC0, GPR32Opnd:$rt), 1>, ASE_MT; } diff --git a/lib/Target/Mips/MipsSEFrameLowering.cpp b/lib/Target/Mips/MipsSEFrameLowering.cpp index 102ebb21609a..735461c2a797 100644 --- a/lib/Target/Mips/MipsSEFrameLowering.cpp +++ b/lib/Target/Mips/MipsSEFrameLowering.cpp @@ -894,10 +894,12 @@ void MipsSEFrameLowering::determineCalleeSaves(MachineFunction &MF, } // Set scavenging frame index if necessary. - uint64_t MaxSPOffset = MF.getInfo()->getIncomingArgSize() + - estimateStackSize(MF); + uint64_t MaxSPOffset = estimateStackSize(MF); - if (isInt<16>(MaxSPOffset)) + // MSA has a minimum offset of 10 bits signed. If there is a variable + // sized object on the stack, the estimation cannot account for it. + if (isIntN(STI.hasMSA() ? 10 : 16, MaxSPOffset) && + !MF.getFrameInfo().hasVarSizedObjects()) return; const TargetRegisterClass &RC = diff --git a/lib/Target/Mips/MipsSEInstrInfo.cpp b/lib/Target/Mips/MipsSEInstrInfo.cpp index ee074798563d..d2c21691abb0 100644 --- a/lib/Target/Mips/MipsSEInstrInfo.cpp +++ b/lib/Target/Mips/MipsSEInstrInfo.cpp @@ -226,6 +226,8 @@ storeRegToStack(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, Opc = Mips::SW; else if (Mips::HI64RegClass.hasSubClassEq(RC)) Opc = Mips::SD; + else if (Mips::DSPRRegClass.hasSubClassEq(RC)) + Opc = Mips::SWDSP; // Hi, Lo are normally caller save but they are callee save // for interrupt handling. @@ -302,6 +304,8 @@ loadRegFromStack(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, Opc = Mips::LW; else if (Mips::LO64RegClass.hasSubClassEq(RC)) Opc = Mips::LD; + else if (Mips::DSPRRegClass.hasSubClassEq(RC)) + Opc = Mips::LWDSP; assert(Opc && "Register class not handled!"); diff --git a/lib/Target/Mips/MipsSchedule.td b/lib/Target/Mips/MipsSchedule.td index c2947bb44ef5..8ec55ab6284d 100644 --- a/lib/Target/Mips/MipsSchedule.td +++ b/lib/Target/Mips/MipsSchedule.td @@ -226,6 +226,7 @@ def II_MFC1 : InstrItinClass; def II_MFHC1 : InstrItinClass; def II_MFC2 : InstrItinClass; def II_MFHI_MFLO : InstrItinClass; // mfhi and mflo +def II_MFTR : InstrItinClass; def II_MOD : InstrItinClass; def II_MODU : InstrItinClass; def II_MOVE : InstrItinClass; @@ -255,6 +256,7 @@ def II_MTC1 : InstrItinClass; def II_MTHC1 : InstrItinClass; def II_MTC2 : InstrItinClass; def II_MTHI_MTLO : InstrItinClass; // mthi and mtlo +def II_MTTR : InstrItinClass; def II_MUL : InstrItinClass; def II_MUH : InstrItinClass; def II_MUHU : InstrItinClass; @@ -664,12 +666,14 @@ def MipsGenericItineraries : ProcessorItineraries<[ALU, IMULDIV], [], [ InstrItinData]>, InstrItinData]>, InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, + InstrItinData]>, InstrItinData]>, InstrItinData]>, InstrItinData]>, diff --git a/lib/Target/Mips/MipsScheduleGeneric.td b/lib/Target/Mips/MipsScheduleGeneric.td index 89cda676441e..e4c52a4e1825 100644 --- a/lib/Target/Mips/MipsScheduleGeneric.td +++ b/lib/Target/Mips/MipsScheduleGeneric.td @@ -268,9 +268,11 @@ def : ItinRW<[GenericWriteLoad], [II_LWLE, II_LWRE]>; // MIPS MT instructions // ==================== -def : ItinRW<[GenericWriteMove], [II_DMT, II_DVPE, II_EMT, II_EVPE]>; +def : ItinRW<[GenericWriteMove], [II_DMT, II_DVPE, II_EMT, II_EVPE, II_MFTR, + II_MTTR]>; def : ItinRW<[GenericReadWriteCOP0Long], [II_YIELD]>; + def : ItinRW<[GenericWriteCOP0Short], [II_FORK]>; // MIPS32R6 and MIPS16e diff --git a/lib/Target/Mips/MipsTargetStreamer.h b/lib/Target/Mips/MipsTargetStreamer.h index 7d9f99ce071e..af24838665e1 100644 --- a/lib/Target/Mips/MipsTargetStreamer.h +++ b/lib/Target/Mips/MipsTargetStreamer.h @@ -119,6 +119,9 @@ class MipsTargetStreamer : public MCTargetStreamer { SMLoc IDLoc, const MCSubtargetInfo *STI); void emitRRI(unsigned Opcode, unsigned Reg0, unsigned Reg1, int16_t Imm, SMLoc IDLoc, const MCSubtargetInfo *STI); + void emitRRIII(unsigned Opcode, unsigned Reg0, unsigned Reg1, int16_t Imm0, + int16_t Imm1, int16_t Imm2, SMLoc IDLoc, + const MCSubtargetInfo *STI); void emitAddu(unsigned DstReg, unsigned SrcReg, unsigned TrgReg, bool Is64Bit, const MCSubtargetInfo *STI); void emitDSLL(unsigned DstReg, unsigned SrcReg, int16_t ShiftAmount, diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 957b46c40a6e..607bc4530abb 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -7026,6 +7026,18 @@ X86TargetLowering::LowerBUILD_VECTORvXi1(SDValue Op, SelectionDAG &DAG) const { return DAG.getTargetConstant(1, dl, VT); if (ISD::isBuildVectorOfConstantSDNodes(Op.getNode())) { + if (VT == MVT::v64i1 && !Subtarget.is64Bit()) { + // Split the pieces. + SDValue Lower = + DAG.getBuildVector(MVT::v32i1, dl, Op.getNode()->ops().slice(0, 32)); + SDValue Upper = + DAG.getBuildVector(MVT::v32i1, dl, Op.getNode()->ops().slice(32, 32)); + // We have to manually lower both halves so getNode doesn't try to + // reassemble the build_vector. + Lower = LowerBUILD_VECTORvXi1(Lower, DAG); + Upper = LowerBUILD_VECTORvXi1(Upper, DAG); + return DAG.getNode(ISD::CONCAT_VECTORS, dl, MVT::v64i1, Lower, Upper); + } SDValue Imm = ConvertI1VectorToInteger(Op, DAG); if (Imm.getValueSizeInBits() == VT.getSizeInBits()) return DAG.getBitcast(VT, Imm); @@ -34733,6 +34745,11 @@ static SDValue combineVectorSizedSetCCEquality(SDNode *SetCC, SelectionDAG &DAG, if (!OpVT.isScalarInteger() || OpSize < 128 || isNullConstant(Y)) return SDValue(); + // Bail out if we know that this is not really just an oversized integer. + if (peekThroughBitcasts(X).getValueType() == MVT::f128 || + peekThroughBitcasts(Y).getValueType() == MVT::f128) + return SDValue(); + // TODO: Use PXOR + PTEST for SSE4.1 or later? // TODO: Add support for AVX-512. EVT VT = SetCC->getValueType(0); diff --git a/test/Bitcode/upgrade-module-flag.ll b/test/Bitcode/upgrade-module-flag.ll index de6c9b2cf1bb..539265beed9e 100644 --- a/test/Bitcode/upgrade-module-flag.ll +++ b/test/Bitcode/upgrade-module-flag.ll @@ -1,13 +1,15 @@ ; RUN: llvm-as < %s | llvm-dis | FileCheck %s ; RUN: verify-uselistorder < %s -!llvm.module.flags = !{!0, !1, !2} +!llvm.module.flags = !{!0, !1, !2, !3} !0 = !{i32 1, !"PIC Level", i32 1} !1 = !{i32 1, !"PIE Level", i32 1} !2 = !{i32 1, !"Objective-C Image Info Version", i32 0} +!3 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"} ; CHECK: !0 = !{i32 7, !"PIC Level", i32 1} ; CHECK: !1 = !{i32 7, !"PIE Level", i32 1} ; CHECK: !2 = !{i32 1, !"Objective-C Image Info Version", i32 0} -; CHECK: !3 = !{i32 4, !"Objective-C Class Properties", i32 0} +; CHECK: !3 = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"} +; CHECK: !4 = !{i32 4, !"Objective-C Class Properties", i32 0} diff --git a/test/Bitcode/upgrade-section-name.ll b/test/Bitcode/upgrade-section-name.ll new file mode 100644 index 000000000000..fcc7228f5fd9 --- /dev/null +++ b/test/Bitcode/upgrade-section-name.ll @@ -0,0 +1,31 @@ +; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s + +%struct._class_t = type { %struct._class_t*, %struct._class_t*, %struct._objc_cache*, i8* (i8*, i8*)**, %struct._class_ro_t* } +%struct._objc_cache = type opaque +%struct._class_ro_t = type { i32, i32, i32, i8*, i8*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._ivar_list_t*, i8*, %struct._prop_list_t* } +%struct.__method_list_t = type { i32, i32, [0 x %struct._objc_method] } +%struct._objc_method = type { i8*, i8*, i8* } +%struct._objc_protocol_list = type { i64, [0 x %struct._protocol_t*] } +%struct._protocol_t = type { i8*, i8*, %struct._objc_protocol_list*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._prop_list_t*, i32, i32, i8**, i8*, %struct._prop_list_t* } +%struct._ivar_list_t = type { i32, i32, [0 x %struct._ivar_t] } +%struct._ivar_t = type { i64*, i8*, i8*, i32, i32 } +%struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] } +%struct._prop_t = type { i8*, i8* } +%struct._category_t = type { i8*, %struct._class_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._prop_list_t*, %struct._prop_list_t*, i32 } + +@OBJC_CLASS_NAME_ = private unnamed_addr constant [6 x i8] c"Robot\00", section "__TEXT,__objc_classname,cstring_literals", align 1 +@"OBJC_CLASS_$_I" = external global %struct._class_t +@"\01l_OBJC_$_CATEGORY_I_$_Robot" = private global %struct._category_t { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), %struct._class_t* @"OBJC_CLASS_$_I", %struct.__method_list_t* null, %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._prop_list_t* null, %struct._prop_list_t* null, i32 64 }, section "__DATA, __objc_const", align 8 +@"OBJC_LABEL_CATEGORY_$" = private global [1 x i8*] [i8* bitcast (%struct._category_t* @"\01l_OBJC_$_CATEGORY_I_$_Robot" to i8*)], section "__DATA, __objc_catlist, regular, no_dead_strip", align 8 +@llvm.compiler.used = appending global [3 x i8*] [i8* bitcast (%struct._category_t* @"\01l_OBJC_$_CATEGORY_I_$_Robot" to i8*), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* bitcast ([1 x i8*]* @"OBJC_LABEL_CATEGORY_$" to i8*)], section "llvm.metadata" + +!llvm.module.flags = !{!0, !1, !2, !3, !4, !5} + +!0 = !{i32 1, !"Objective-C Version", i32 2} +!1 = !{i32 1, !"Objective-C Image Info Version", i32 0} +!2 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"} +!3 = !{i32 4, !"Objective-C Garbage Collection", i32 0} +!4 = !{i32 1, !"Objective-C Class Properties", i32 64} +!5 = !{i32 1, !"PIC Level", i32 2} + +; CHECK: @"OBJC_LABEL_CATEGORY_$" = {{.*}}, section "__DATA,__objc_catlist,regular,no_dead_strip" diff --git a/test/CodeGen/AArch64/arm64-memset-inline.ll b/test/CodeGen/AArch64/arm64-memset-inline.ll index 384aaa8541df..8c872cc61500 100644 --- a/test/CodeGen/AArch64/arm64-memset-inline.ll +++ b/test/CodeGen/AArch64/arm64-memset-inline.ll @@ -12,9 +12,9 @@ entry: define void @t2() nounwind ssp { entry: ; CHECK-LABEL: t2: +; CHECK: stp xzr, xzr, [sp, #16] ; CHECK: strh wzr, [sp, #32] -; CHECK: stp xzr, xzr, [sp, #8] -; CHECK: str xzr, [sp, #24] +; CHECK: str xzr, [sp, #8] %buf = alloca [26 x i8], align 1 %0 = getelementptr inbounds [26 x i8], [26 x i8]* %buf, i32 0, i32 0 call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 26, i32 1, i1 false) diff --git a/test/CodeGen/AArch64/cmp-frameindex.ll b/test/CodeGen/AArch64/cmp-frameindex.ll new file mode 100644 index 000000000000..2d01b76e186c --- /dev/null +++ b/test/CodeGen/AArch64/cmp-frameindex.ll @@ -0,0 +1,19 @@ +; RUN: llc -mtriple=aarch64 %s -o - | FileCheck %s + +; CHECK: test_frameindex_cmp: +; CHECK: cmn sp, #{{[0-9]+}} +define void @test_frameindex_cmp() { + %stack = alloca i8 + %stack.int = ptrtoint i8* %stack to i64 + %cmp = icmp ne i64 %stack.int, 0 + br i1 %cmp, label %bb1, label %bb2 + +bb1: + call void @bar() + ret void + +bb2: + ret void +} + +declare void @bar() diff --git a/test/CodeGen/AArch64/falkor-hwpf-fix.mir b/test/CodeGen/AArch64/falkor-hwpf-fix.mir index 54c8b16a9b43..70da36cdb89a 100644 --- a/test/CodeGen/AArch64/falkor-hwpf-fix.mir +++ b/test/CodeGen/AArch64/falkor-hwpf-fix.mir @@ -1,12 +1,7 @@ # RUN: llc -mtriple=aarch64-linux-gnu -mcpu=falkor -run-pass falkor-hwpf-fix-late -o - %s | FileCheck %s ---- | - @g = external global i32 - - define void @hwpf1() { ret void } - define void @hwpf2() { ret void } -... --- -# Verify that the tag collision between the loads is resolved. +# Verify that the tag collision between the loads is resolved for various load opcodes. + # CHECK-LABEL: name: hwpf1 # CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 # CHECK: LDRWui %[[BASE]], 0 @@ -17,7 +12,7 @@ body: | bb.0: liveins: %w0, %x1 - %w2 = LDRWui %x1, 0 :: ("aarch64-strided-access" load 4 from @g) + %w2 = LDRWui %x1, 0 :: ("aarch64-strided-access" load 4) %w2 = LDRWui %x1, 1 %w0 = SUBWri %w0, 1, 0 @@ -28,19 +23,147 @@ body: | RET_ReallyLR ... --- -# Verify that the tag collision between the loads is resolved and written back for post increment addressing. # CHECK-LABEL: name: hwpf2 # CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 -# CHECK: LDRWpost %[[BASE]], 0 -# CHECK: %x1 = ORRXrs %xzr, %[[BASE]], 0 -# CHECK: LDRWui %x1, 1 +# CHECK: LD1i64 %q2, 0, %[[BASE]] +# CHECK: LDRWui %x1, 0 name: hwpf2 tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %q2 + + %q2 = LD1i64 %q2, 0, %x1 :: ("aarch64-strided-access" load 4) + %w2 = LDRWui %x1, 0 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpf3 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LD1i8 %q2, 0, %[[BASE]] +# CHECK: LDRWui %x1, 0 +name: hwpf3 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %q2 + + %q2 = LD1i8 %q2, 0, %x1 :: ("aarch64-strided-access" load 4) + %w0 = LDRWui %x1, 0 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpf4 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LD1Onev1d %[[BASE]] +# CHECK: LDRWui %x1, 0 +name: hwpf4 +tracksRegLiveness: true body: | bb.0: liveins: %w0, %x1 - %x1, %w2 = LDRWpost %x1, 0 :: ("aarch64-strided-access" load 4 from @g) + %d2 = LD1Onev1d %x1 :: ("aarch64-strided-access" load 4) + %w2 = LDRWui %x1, 0 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpf5 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LD1Twov1d %[[BASE]] +# CHECK: LDRWui %x1, 0 +name: hwpf5 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1 + + %d2_d3 = LD1Twov1d %x1 :: ("aarch64-strided-access" load 4) + %w0 = LDRWui %x1, 0 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpf6 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LDPQi %[[BASE]] +# CHECK: LDRWui %x1, 3 +name: hwpf6 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1 + + %q2, %q3 = LDPQi %x1, 3 :: ("aarch64-strided-access" load 4) + %w0 = LDRWui %x1, 3 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpf7 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LDPXi %[[BASE]] +# CHECK: LDRWui %x1, 2 +name: hwpf7 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1 + + %x2, %x3 = LDPXi %x1, 3 :: ("aarch64-strided-access" load 4) + %w2 = LDRWui %x1, 2 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# Verify that the tag collision between the loads is resolved and written back +# for post increment addressing for various load opcodes. + +# CHECK-LABEL: name: hwpfinc1 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LDRWpost %[[BASE]], 0 +# CHECK: %x1 = ORRXrs %xzr, %[[BASE]], 0 +# CHECK: LDRWui %x1, 1 +name: hwpfinc1 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1 + + %x1, %w2 = LDRWpost %x1, 0 :: ("aarch64-strided-access" load 4) %w2 = LDRWui %x1, 1 %w0 = SUBWri %w0, 1, 0 @@ -50,3 +173,160 @@ body: | bb.1: RET_ReallyLR ... +--- +# CHECK-LABEL: name: hwpfinc2 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LD1i64_POST %q2, 0, %[[BASE]] +# CHECK: %x1 = ORRXrs %xzr, %[[BASE]], 0 +# CHECK: LDRWui %x1, 1 +name: hwpfinc2 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %q2 + + %x1, %q2 = LD1i64_POST %q2, 0, %x1, %x1 :: ("aarch64-strided-access" load 4) + %w2 = LDRWui %x1, 132 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpfinc3 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LD1i8_POST %q2, 0, %[[BASE]] +# CHECK: %x1 = ORRXrs %xzr, %[[BASE]], 0 +# CHECK: LDRWui %x1, 132 +name: hwpfinc3 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %q2 + + %x1, %q2 = LD1i8_POST %q2, 0, %x1, %x1 :: ("aarch64-strided-access" load 4) + %w0 = LDRWui %x1, 132 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpfinc4 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LD1Rv1d_POST %[[BASE]] +# CHECK: %x1 = ORRXrs %xzr, %[[BASE]], 0 +# CHECK: LDRWui %x1, 252 +name: hwpfinc4 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %q2 + + %x1, %d2 = LD1Rv1d_POST %x1, %xzr :: ("aarch64-strided-access" load 4) + %w2 = LDRWui %x1, 252 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpfinc5 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LD3Threev2s_POST %[[BASE]] +# CHECK: %x1 = ORRXrs %xzr, %[[BASE]], 0 +# CHECK: LDRWroX %x17, %x0 +name: hwpfinc5 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %x17, %q2 + + %x1, %d2_d3_d4 = LD3Threev2s_POST %x1, %x0 :: ("aarch64-strided-access" load 4) + %w0 = LDRWroX %x17, %x0, 0, 0 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpfinc6 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LDPDpost %[[BASE]] +# CHECK: %x1 = ORRXrs %xzr, %[[BASE]], 0 +# CHECK: LDRWui %x17, 2 +name: hwpfinc6 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %x17, %q2 + + %x1, %d2, %d3 = LDPDpost %x1, 3 :: ("aarch64-strided-access" load 4) + %w16 = LDRWui %x17, 2 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# CHECK-LABEL: name: hwpfinc7 +# CHECK: %[[BASE:[a-z0-9]+]] = ORRXrs %xzr, %x1, 0 +# CHECK: LDPXpost %[[BASE]] +# CHECK: %x1 = ORRXrs %xzr, %[[BASE]], 0 +# CHECK: LDRWui %x17, 2 +name: hwpfinc7 +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %x17, %q2 + + %x1, %x2, %x3 = LDPXpost %x1, 3 :: ("aarch64-strided-access" load 4) + %w18 = LDRWui %x17, 2 + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... +--- +# Check that we handle case of strided load with no HW prefetcher tag correctly. + +# CHECK-LABEL: name: hwpf_notagbug +# CHECK-NOT: ORRXrs %xzr +# CHECK: LDARW %x1 +# CHECK-NOT: ORRXrs %xzr +# CHECK: LDRWui %x1 +name: hwpf_notagbug +tracksRegLiveness: true +body: | + bb.0: + liveins: %w0, %x1, %x17 + + %w1 = LDARW %x1 :: ("aarch64-strided-access" load 4) + %w1 = LDRWui %x1, 0 :: ("aarch64-strided-access" load 4) + %w17 = LDRWui %x17, 0 :: ("aarch64-strided-access" load 4) + + %w0 = SUBWri %w0, 1, 0 + %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv + Bcc 9, %bb.0, implicit %nzcv + + bb.1: + RET_ReallyLR +... diff --git a/test/CodeGen/AArch64/fastcc.ll b/test/CodeGen/AArch64/fastcc.ll index fcc852263b48..3ea6df5be49c 100644 --- a/test/CodeGen/AArch64/fastcc.ll +++ b/test/CodeGen/AArch64/fastcc.ll @@ -21,9 +21,11 @@ define fastcc void @func_stack0() { call fastcc void @func_stack8([8 x i32] undef, i32 42) ; CHECK: bl func_stack8 ; CHECK-NOT: sub sp, sp, +; CHECK-NOT: [sp, #{{[-0-9]+}}]! +; CHECK-NOT: [sp], #{{[-0-9]+}} ; CHECK-TAIL: bl func_stack8 -; CHECK-TAIL: sub sp, sp, #16 +; CHECK-TAIL: stp xzr, xzr, [sp, #-16]! call fastcc void @func_stack32([8 x i32] undef, i128 0, i128 9) @@ -72,10 +74,12 @@ define fastcc void @func_stack8([8 x i32], i32 %stacked) { call fastcc void @func_stack8([8 x i32] undef, i32 42) ; CHECK: bl func_stack8 ; CHECK-NOT: sub sp, sp, +; CHECK-NOT: [sp, #{{[-0-9]+}}]! +; CHECK-NOT: [sp], #{{[-0-9]+}} ; CHECK-TAIL: bl func_stack8 -; CHECK-TAIL: sub sp, sp, #16 +; CHECK-TAIL: stp xzr, xzr, [sp, #-16]! call fastcc void @func_stack32([8 x i32] undef, i128 0, i128 9) @@ -116,9 +120,11 @@ define fastcc void @func_stack32([8 x i32], i128 %stacked0, i128 %stacked1) { call fastcc void @func_stack8([8 x i32] undef, i32 42) ; CHECK: bl func_stack8 ; CHECK-NOT: sub sp, sp, +; CHECK-NOT: [sp, #{{[-0-9]+}}]! +; CHECK-NOT: [sp], #{{[-0-9]+}} ; CHECK-TAIL: bl func_stack8 -; CHECK-TAIL: sub sp, sp, #16 +; CHECK-TAIL: stp xzr, xzr, [sp, #-16]! call fastcc void @func_stack32([8 x i32] undef, i128 0, i128 9) diff --git a/test/CodeGen/AArch64/ldst-opt.ll b/test/CodeGen/AArch64/ldst-opt.ll index 975e5ae8b953..2b98d3215e49 100644 --- a/test/CodeGen/AArch64/ldst-opt.ll +++ b/test/CodeGen/AArch64/ldst-opt.ll @@ -1667,4 +1667,17 @@ entry: ret void } - +; Check for bug 34674 where invalid add of xzr was being generated. +; CHECK-LABEL: bug34674: +; CHECK: // %entry +; CHECK-NEXT: mov [[ZREG:x[0-9]+]], xzr +; CHECK-DAG: stp [[ZREG]], [[ZREG]], [x0] +; CHECK-DAG: add x{{[0-9]+}}, [[ZREG]], #1 +define i64 @bug34674(<2 x i64>* %p) { +entry: + store <2 x i64> zeroinitializer, <2 x i64>* %p + %p2 = bitcast <2 x i64>* %p to i64* + %ld = load i64, i64* %p2 + %add = add i64 %ld, 1 + ret i64 %add +} diff --git a/test/CodeGen/AArch64/thread-pointer.ll b/test/CodeGen/AArch64/thread-pointer.ll deleted file mode 100644 index 7fea719436f9..000000000000 --- a/test/CodeGen/AArch64/thread-pointer.ll +++ /dev/null @@ -1,60 +0,0 @@ -; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s - -@x = thread_local local_unnamed_addr global i32 0, align 4 -@y = thread_local local_unnamed_addr global i32 0, align 4 - -; Machine LICM should hoist the mrs into the loop preheader. -; CHECK-LABEL: @test1 -; CHECK: BB#1: -; CHECK: mrs x[[BASE:[0-9]+]], TPIDR_EL0 -; CHECK: add x[[REG1:[0-9]+]], x[[BASE]], :tprel_hi12:x -; CHECK: add x[[REG2:[0-9]+]], x[[REG1]], :tprel_lo12_nc:x -; -; CHECK: .LBB0_2: -; CHECK: ldr w0, [x[[REG2]]] -; CHECK: bl bar -; CHECK: subs w[[REG3:[0-9]+]], w{{[0-9]+}}, #1 -; CHECK: b.ne .LBB0_2 - -define void @test1(i32 %n) local_unnamed_addr { -entry: - %cmp3 = icmp sgt i32 %n, 0 - br i1 %cmp3, label %bb1, label %bb2 - -bb1: - br label %for.body - -for.body: - %i.04 = phi i32 [ %inc, %for.body ], [ 0, %bb1 ] - %0 = load i32, i32* @x, align 4 - tail call void @bar(i32 %0) #2 - %inc = add nuw nsw i32 %i.04, 1 - %exitcond = icmp eq i32 %inc, %n - br i1 %exitcond, label %bb2, label %for.body - -bb2: - ret void -} - -; Machine CSE should combine the the mrs between the load of %x and %y. -; CHECK-LABEL: @test2 -; CHECK: mrs x{{[0-9]+}}, TPIDR_EL0 -; CHECK-NOT: mrs x{{[0-9]+}}, TPIDR_EL0 -; CHECK: ret -define void @test2(i32 %c) local_unnamed_addr #0 { -entry: - %0 = load i32, i32* @x, align 4 - tail call void @bar(i32 %0) #2 - %cmp = icmp eq i32 %c, 0 - br i1 %cmp, label %if.end, label %if.then - -if.then: - %1 = load i32, i32* @y, align 4 - tail call void @bar(i32 %1) #2 - br label %if.end - -if.end: - ret void -} - -declare void @bar(i32) local_unnamed_addr diff --git a/test/CodeGen/AMDGPU/hazard.mir b/test/CodeGen/AMDGPU/hazard.mir new file mode 100644 index 000000000000..d495a327e9e3 --- /dev/null +++ b/test/CodeGen/AMDGPU/hazard.mir @@ -0,0 +1,31 @@ +# RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN -check-prefix=VI %s +# RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass post-RA-hazard-rec %s -o - | FileCheck -check-prefix=GCN -check-prefix=GFX9 %s + +# GCN: bb.0.entry: +# GCN: %m0 = S_MOV_B32 +# GFX9: S_NOP 0 +# VI-NOT: S_NOP_0 +# GCN: V_INTERP_P1_F32 + +--- +name: hazard_implicit_def +alignment: 0 +exposesReturnsTwice: false +legalized: false +regBankSelected: false +selected: false +tracksRegLiveness: true +registers: +liveins: + - { reg: '%sgpr7', virtual-reg: '' } + - { reg: '%vgpr4', virtual-reg: '' } +body: | + bb.0.entry: + liveins: %sgpr7, %vgpr4 + + %m0 = S_MOV_B32 killed %sgpr7 + %vgpr5 = IMPLICIT_DEF + %vgpr0 = V_INTERP_P1_F32 killed %vgpr4, 0, 0, implicit %m0, implicit %exec + SI_RETURN_TO_EPILOG killed %vgpr5, killed %vgpr0 + +... diff --git a/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll b/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll index f50916e4b474..82e9b20731e4 100644 --- a/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll +++ b/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll @@ -1,5 +1,5 @@ -; RUN: llc -mtriple arm-unknown -mattr=+vfp2 -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=LITTLE -; RUN: llc -mtriple armeb-unknown -mattr=+vfp2 -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=BIG +; RUN: llc -mtriple arm-unknown -mattr=+vfp2,+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=LITTLE +; RUN: llc -mtriple armeb-unknown -mattr=+vfp2,+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=CHECK -check-prefix=BIG define void @test_void_return() { ; CHECK-LABEL: name: test_void_return diff --git a/test/CodeGen/ARM/armv4.ll b/test/CodeGen/ARM/armv4.ll index 6b213d564bd6..a0379caaa4fb 100644 --- a/test/CodeGen/ARM/armv4.ll +++ b/test/CodeGen/ARM/armv4.ll @@ -5,9 +5,24 @@ ; RUN: llc < %s -mtriple=armv4-unknown-eabi | FileCheck %s -check-prefix=ARM ; RUN: llc < %s -mtriple=armv4t-unknown-eabi | FileCheck %s -check-prefix=THUMB -define i32 @test(i32 %a) nounwind readnone { +define i32 @test_return(i32 %a) nounwind readnone { entry: +; ARM-LABEL: test_return ; ARM: mov pc +; THUMB-LABEL: test_return ; THUMB: bx ret i32 %a } + +@helper = global i32 ()* null, align 4 + +define i32 @test_indirect() #0 { +entry: +; ARM-LABEL: test_indirect +; ARM: mov pc +; THUMB-LABEL: test_indirect +; THUMB: bx + %0 = load i32 ()*, i32 ()** @helper, align 4 + %call = tail call i32 %0() + ret i32 %call +} diff --git a/test/CodeGen/ARM/debug-segmented-stacks.ll b/test/CodeGen/ARM/debug-segmented-stacks.ll index 3aa33f754118..6dafcecf0f00 100644 --- a/test/CodeGen/ARM/debug-segmented-stacks.ll +++ b/test/CodeGen/ARM/debug-segmented-stacks.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -verify-machineinstrs -filetype=asm | FileCheck %s -check-prefix=ARM-linux -; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -filetype=obj +; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -verify-machineinstrs -filetype=asm | FileCheck %s -check-prefix=ARM-linux +; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -filetype=obj !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9, !10} diff --git a/test/CodeGen/ARM/no-fpscr-liveness.ll b/test/CodeGen/ARM/no-fpscr-liveness.ll new file mode 100644 index 000000000000..6575ab6c55d5 --- /dev/null +++ b/test/CodeGen/ARM/no-fpscr-liveness.ll @@ -0,0 +1,49 @@ +; RUN: llc -o - %s | FileCheck %s +; Make sure we do not try to compute liveness for FPSCR which in this case +; is read before being written to (this is fine because becase FPSCR is +; reserved). +target triple = "thumbv7s-apple-ios" + +%struct.wibble = type { double } + +@global = common global i32 0, align 4 +@global.1 = common global i32 0, align 4 + +; CHECK-LABEL: eggs: +; CHECK: sub sp, #8 +; VMRS instruction comes before any other instruction writing FPSCR: +; CHECK-NEXT: vmrs r0, fpscr +; ... +; CHECK: add sp, #8 +; CHECK: bx lr +define i32 @eggs(double* nocapture readnone %arg) { +bb: + %tmp = alloca %struct.wibble, align 4 + %tmp1 = bitcast %struct.wibble* %tmp to i8* + %tmp2 = tail call i32 @llvm.flt.rounds() + %tmp3 = ptrtoint %struct.wibble* %tmp to i32 + %tmp4 = sitofp i32 %tmp3 to double + %tmp5 = fmul double %tmp4, 0x0123456789ABCDEF + %tmp6 = fptosi double %tmp5 to i32 + %tmp7 = fcmp une double %tmp5, 0.000000e+00 + %tmp8 = sitofp i32 %tmp6 to double + %tmp9 = fcmp une double %tmp5, %tmp8 + %tmp10 = and i1 %tmp7, %tmp9 + %tmp11 = sext i1 %tmp10 to i32 + %tmp12 = add nsw i32 %tmp11, %tmp6 + store i32 %tmp12, i32* @global, align 4 + %tmp13 = icmp ne i32 %tmp12, 0 + %tmp14 = icmp ne i32 %tmp2, 0 + %tmp15 = and i1 %tmp14, %tmp13 + br i1 %tmp15, label %bb16, label %bb18 + +bb16: ; preds = %bb + %tmp17 = load i32, i32* @global.1, align 4 + br label %bb18 + +bb18: ; preds = %bb16, %bb + ret i32 undef +} + +declare i32 @llvm.flt.rounds() +declare i32 @zot(...) diff --git a/test/CodeGen/ARM/pr32578.ll b/test/CodeGen/ARM/pr32578.ll new file mode 100644 index 000000000000..541ba35e5be5 --- /dev/null +++ b/test/CodeGen/ARM/pr32578.ll @@ -0,0 +1,27 @@ +; RUN: llc -o - %s | FileCheck %s +target triple = "armv7" + +; CHECK-LABEL: func: +; CHECK: push {r11, lr} +; CHECK: vpush {d8} +; CEHCK: b .LBB0_2 +define arm_aapcscc double @func() { + br label %tailrecurse + +tailrecurse: + %v0 = load i16, i16* undef, align 8 + %cond36.i = icmp eq i16 %v0, 3 + br i1 %cond36.i, label %sw.bb.i, label %sw.epilog.i + +sw.bb.i: + %v1 = load double, double* undef, align 8 + %call21.i = tail call arm_aapcscc double @func() + %mul.i = fmul double %v1, %call21.i + ret double %mul.i + +sw.epilog.i: + tail call arm_aapcscc void @_ZNK10shared_ptrdeEv() + br label %tailrecurse +} + +declare arm_aapcscc void @_ZNK10shared_ptrdeEv() local_unnamed_addr diff --git a/test/CodeGen/ARM/segmented-stacks-dynamic.ll b/test/CodeGen/ARM/segmented-stacks-dynamic.ll index 86f8ff8dd90b..65d25cad386e 100644 --- a/test/CodeGen/ARM/segmented-stacks-dynamic.ll +++ b/test/CodeGen/ARM/segmented-stacks-dynamic.ll @@ -1,7 +1,7 @@ -; RUN: llc < %s -mtriple=arm-linux-androideabi -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android -; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux -; RUN: llc < %s -mtriple=arm-linux-androideabi -filetype=obj -; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -filetype=obj +; RUN: llc < %s -mtriple=arm-linux-androideabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android +; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux +; RUN: llc < %s -mtriple=arm-linux-androideabi -mattr=+v4t -filetype=obj +; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -filetype=obj ; Just to prevent the alloca from being optimized away declare void @dummy_use(i32*, i32) diff --git a/test/CodeGen/ARM/segmented-stacks.ll b/test/CodeGen/ARM/segmented-stacks.ll index cbb124de11c3..4fe84faa17fd 100644 --- a/test/CodeGen/ARM/segmented-stacks.ll +++ b/test/CodeGen/ARM/segmented-stacks.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -mtriple=arm-linux-androideabi -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android -; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux +; RUN: llc < %s -mtriple=arm-linux-androideabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android +; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux ; We used to crash with filetype=obj ; RUN: llc < %s -mtriple=arm-linux-androideabi -filetype=obj diff --git a/test/CodeGen/AVR/atomics/load-store-16-unexpected-register-bug.ll b/test/CodeGen/AVR/atomics/load-store-16-unexpected-register-bug.ll new file mode 100644 index 000000000000..9c72940b2b79 --- /dev/null +++ b/test/CodeGen/AVR/atomics/load-store-16-unexpected-register-bug.ll @@ -0,0 +1,23 @@ +; RUN: llc < %s -march=avr | FileCheck %s + +; At one point, the 16-vit atomic load/store operations we defined in TableGen +; to use 'PTRREGS', but the pseudo expander would generate LDDW/STDW instructions. +; +; This would sometimes cause codegen to fail because LDDW requires 'PTRDISPREGS', and +; so if we attempted to generate an atomic operation on the X register, it would hit +; an assertion; + +%AtomicI16 = type { %UnsafeCell, [0 x i8] } +%UnsafeCell = type { i16, [0 x i8] } + +; CHECK-LABEL: foo +define i8 @foo(%AtomicI16*) { +start: + +; We should not be generating atomics that use the X register, they will fail when emitting MC. +; CHECK-NOT: X + %1 = getelementptr inbounds %AtomicI16, %AtomicI16* %0, i16 0, i32 0, i32 0 + %2 = load atomic i16, i16* %1 seq_cst, align 2 + ret i8 0 +} + diff --git a/test/CodeGen/AVR/atomics/load16.ll b/test/CodeGen/AVR/atomics/load16.ll index ea021c0724b9..2b51afe45f4f 100644 --- a/test/CodeGen/AVR/atomics/load16.ll +++ b/test/CodeGen/AVR/atomics/load16.ll @@ -3,8 +3,8 @@ ; CHECK-LABEL: atomic_load16 ; CHECK: in r0, 63 ; CHECK-NEXT: cli +; CHECK-NEXT: ld [[RR:r[0-9]+]], [[RD:(X|Y|Z)]]+ ; CHECK-NEXT: ld [[RR:r[0-9]+]], [[RD:(X|Y|Z)]] -; CHECK-NEXT: ldd [[RR:r[0-9]+]], [[RD:(X|Y|Z)]]+ ; CHECK-NEXT: out 63, r0 define i16 @atomic_load16(i16* %foo) { %val = load atomic i16, i16* %foo unordered, align 2 @@ -29,8 +29,8 @@ define i16 @atomic_load_cmp_swap16(i16* %foo) { ; CHECK-LABEL: atomic_load_add16 ; CHECK: in r0, 63 ; CHECK-NEXT: cli -; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]] -; CHECK-NEXT: ldd [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]] ; CHECK-NEXT: add [[RR1]], [[TMP:r[0-9]+]] ; CHECK-NEXT: adc [[RR2]], [[TMP:r[0-9]+]] ; CHECK-NEXT: st [[RD1]], [[RR1]] @@ -44,8 +44,8 @@ define i16 @atomic_load_add16(i16* %foo) { ; CHECK-LABEL: atomic_load_sub16 ; CHECK: in r0, 63 ; CHECK-NEXT: cli -; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]] -; CHECK-NEXT: ldd [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]] ; CHECK-NEXT: sub [[RR1]], [[TMP:r[0-9]+]] ; CHECK-NEXT: sbc [[RR2]], [[TMP:r[0-9]+]] ; CHECK-NEXT: st [[RD1]], [[RR1]] @@ -59,8 +59,8 @@ define i16 @atomic_load_sub16(i16* %foo) { ; CHECK-LABEL: atomic_load_and16 ; CHECK: in r0, 63 ; CHECK-NEXT: cli -; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]] -; CHECK-NEXT: ldd [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]] ; CHECK-NEXT: and [[RR1]], [[TMP:r[0-9]+]] ; CHECK-NEXT: and [[RR2]], [[TMP:r[0-9]+]] ; CHECK-NEXT: st [[RD1]], [[RR1]] @@ -74,8 +74,8 @@ define i16 @atomic_load_and16(i16* %foo) { ; CHECK-LABEL: atomic_load_or16 ; CHECK: in r0, 63 ; CHECK-NEXT: cli -; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]] -; CHECK-NEXT: ldd [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]] ; CHECK-NEXT: or [[RR1]], [[TMP:r[0-9]+]] ; CHECK-NEXT: or [[RR2]], [[TMP:r[0-9]+]] ; CHECK-NEXT: st [[RD1]], [[RR1]] @@ -89,8 +89,8 @@ define i16 @atomic_load_or16(i16* %foo) { ; CHECK-LABEL: atomic_load_xor16 ; CHECK: in r0, 63 ; CHECK-NEXT: cli -; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]] -; CHECK-NEXT: ldd [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR1:r[0-9]+]], [[RD1:(X|Y|Z)]]+ +; CHECK-NEXT: ld [[RR2:r[0-9]+]], [[RD2:(X|Y|Z)]] ; CHECK-NEXT: eor [[RR1]], [[TMP:r[0-9]+]] ; CHECK-NEXT: eor [[RR2]], [[TMP:r[0-9]+]] ; CHECK-NEXT: st [[RD1]], [[RR1]] diff --git a/test/CodeGen/AVR/branch-relaxation-long.ll b/test/CodeGen/AVR/branch-relaxation-long.ll new file mode 100644 index 000000000000..2cfc7e812ebc --- /dev/null +++ b/test/CodeGen/AVR/branch-relaxation-long.ll @@ -0,0 +1,4137 @@ +; RUN: llc < %s -march=avr | FileCheck %s + +; CHECK-LABEL: relax_to_jmp: +; CHECK: cpi r{{[0-9]+}}, 0 +; CHECK: brne [[BB1:LBB[0-9]+_[0-9]+]] +; CHECK: jmp [[BB2:LBB[0-9]+_[0-9]+]] +; CHECK: [[BB1]]: +; CHECK: nop +; CHECK: [[BB2]]: +define i8 @relax_to_jmp(i1 %a) { +entry-block: + br i1 %a, label %hello, label %finished +hello: + ; with >4 kB of instructions (2050 NOPs), this requires a long jump (jmp), + ; versus a relative one (rjmp). + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + br label %finished +finished: + ret i8 3 +} + +; CHECK-LABEL: relax_to_jmp_backwards: +; CHECK: [[BB1:LBB[0-9]+_[0-9]+]] +; CHECK: nop +; CHECK: cpi r{{[0-9]+}}, 0 +; CHECK: breq [[BB2:LBB[0-9]+_[0-9]+]] +; CHECK: jmp [[BB1]] +; CHECK: [[BB2]]: +define i8 @relax_to_jmp_backwards(i1 %a) { +entry-block: + br label %hello +hello: + ; with >4 kB of instructions (2050 NOPs), this requires a long jump (jmp), + ; versus a relative one (rjmp). + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + call void asm sideeffect "nop", ""() + br i1 %a, label %hello, label %finished +finished: + ret i8 3 +} diff --git a/test/CodeGen/AVR/call.ll b/test/CodeGen/AVR/call.ll index bc6cb198a9e5..dd37b384942e 100644 --- a/test/CodeGen/AVR/call.ll +++ b/test/CodeGen/AVR/call.ll @@ -31,8 +31,8 @@ define i8 @calli8_reg() { define i8 @calli8_stack() { ; CHECK-LABEL: calli8_stack: ; CHECK: ldi [[REG1:r[0-9]+]], 10 -; CHECK: push [[REG1]] -; CHECK: ldi [[REG1]], 11 +; CHECK: ldi [[REG2:r[0-9]+]], 11 +; CHECK: push [[REG2]] ; CHECK: push [[REG1]] ; CHECK: call foo8_3 %result1 = call i8 @foo8_3(i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11) @@ -142,7 +142,7 @@ define void @testcallprologue() { ; CHECK-LABEL: testcallprologue: ; CHECK: push r28 ; CHECK: push r29 -; CHECK: sbiw r28, 28 +; CHECK: sbiw r28, 27 ; CHECK: ldi [[REG1:r[0-9]+]], 88 ; CHECK: std Y+9, [[REG1]] ; CHECK: ldi [[REG1:r[0-9]+]], 11 diff --git a/test/CodeGen/AVR/clear-bss.ll b/test/CodeGen/AVR/clear-bss.ll new file mode 100644 index 000000000000..9c63815c098d --- /dev/null +++ b/test/CodeGen/AVR/clear-bss.ll @@ -0,0 +1,5 @@ +; RUN: llc < %s -march=avr | FileCheck %s + +; CHECK: .globl __do_clear_bss +@zeroed = internal constant [3 x i8] zeroinitializer + diff --git a/test/CodeGen/AVR/copy-data-to-ram.ll b/test/CodeGen/AVR/copy-data-to-ram.ll new file mode 100644 index 000000000000..021cc0f1a7f4 --- /dev/null +++ b/test/CodeGen/AVR/copy-data-to-ram.ll @@ -0,0 +1,5 @@ +; RUN: llc < %s -march=avr | FileCheck %s + +; CHECK: .globl __do_copy_data +@str = internal global [3 x i8] c"foo" + diff --git a/test/CodeGen/AVR/directmem.ll b/test/CodeGen/AVR/directmem.ll index 032263a9d657..d0674cbc4595 100644 --- a/test/CodeGen/AVR/directmem.ll +++ b/test/CodeGen/AVR/directmem.ll @@ -33,12 +33,12 @@ define i8 @global8_load() { define void @array8_store() { ; CHECK-LABEL: array8_store: +; CHECK: ldi [[REG1:r[0-9]+]], 3 +; CHECK: sts char.array+2, [[REG1]] +; CHECK: ldi [[REG3:r[0-9]+]], 1 ; CHECK: ldi [[REG2:r[0-9]+]], 2 ; CHECK: sts char.array+1, [[REG2]] -; CHECK: ldi [[REG1:r[0-9]+]], 1 -; CHECK: sts char.array, [[REG1]] -; CHECK: ldi [[REG:r[0-9]+]], 3 -; CHECK: sts char.array+2, [[REG]] +; CHECK: sts char.array, [[REG3]] store i8 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @char.array, i32 0, i64 0) store i8 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @char.array, i32 0, i64 1) store i8 3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @char.array, i32 0, i64 2) diff --git a/test/CodeGen/AVR/load.ll b/test/CodeGen/AVR/load.ll index f5b15d56e614..73568b540965 100644 --- a/test/CodeGen/AVR/load.ll +++ b/test/CodeGen/AVR/load.ll @@ -9,8 +9,8 @@ define i8 @load8(i8* %x) { define i16 @load16(i16* %x) { ; CHECK-LABEL: load16: -; CHECK: ld r24, {{[YZ]}} -; CHECK: ldd r25, {{[YZ]}}+1 +; CHECK: ld r24, {{[XYZ]}}+ +; CHECK: ld r25, {{[XYZ]}} %1 = load i16, i16* %x ret i16 %1 } @@ -45,11 +45,11 @@ define i16 @load16disp(i16* %x) { define i16 @load16nodisp(i16* %x) { ; CHECK-LABEL: load16nodisp: -; CHECK: movw r30, r24 -; CHECK: subi r30, 192 -; CHECK: sbci r31, 255 -; CHECK: ld r24, {{[YZ]}} -; CHECK: ldd r25, {{[YZ]}}+1 +; CHECK: movw r26, r24 +; CHECK: subi r26, 192 +; CHECK: sbci r27, 255 +; CHECK: ld r24, {{[XYZ]}}+ +; CHECK: ld r25, {{[XYZ]}} %1 = getelementptr inbounds i16, i16* %x, i64 32 %2 = load i16, i16* %1 ret i16 %2 diff --git a/test/CodeGen/AVR/pseudo/LDWRdPtr-same-src-dst.mir b/test/CodeGen/AVR/pseudo/LDWRdPtr-same-src-dst.mir index 3e7fdcd400d2..82f1a9a832fc 100644 --- a/test/CodeGen/AVR/pseudo/LDWRdPtr-same-src-dst.mir +++ b/test/CodeGen/AVR/pseudo/LDWRdPtr-same-src-dst.mir @@ -18,9 +18,9 @@ body: | ; CHECK-LABEL: test_ldwrdptr - ; CHECK: ld [[SCRATCH:r[0-9]+]], Z + ; CHECK: ld [[SCRATCH:r[0-9]+]], Z+ ; CHECK-NEXT: push [[SCRATCH]] - ; CHECK-NEXT: ldd [[SCRATCH]], Z+1 + ; CHECK-NEXT: ld [[SCRATCH]], Z ; CHECK-NEXT: mov r31, [[SCRATCH]] ; CHECK-NEXT: pop r30 diff --git a/test/CodeGen/AVR/pseudo/LDWRdPtr.mir b/test/CodeGen/AVR/pseudo/LDWRdPtr.mir index 6db615878b95..3a3ec3c2657f 100644 --- a/test/CodeGen/AVR/pseudo/LDWRdPtr.mir +++ b/test/CodeGen/AVR/pseudo/LDWRdPtr.mir @@ -17,8 +17,8 @@ body: | ; CHECK-LABEL: test_ldwrdptr - ; CHECK: %r0 = LDRdPtr %r31r30 - ; CHECK-NEXT: early-clobber %r1 = LDDRdPtrQ %r31r30, 1 + ; CHECK: %r0, %r31r30 = LDRdPtrPi %r31r30 + ; CHECK-NEXT: %r1 = LDRdPtr %r31r30 %r1r0 = LDWRdPtr %r31r30 ... diff --git a/test/CodeGen/AVR/pseudo/LDWRdPtrPd.mir b/test/CodeGen/AVR/pseudo/LDWRdPtrPd.mir index eb65c6538d11..0c065f83d9a6 100644 --- a/test/CodeGen/AVR/pseudo/LDWRdPtrPd.mir +++ b/test/CodeGen/AVR/pseudo/LDWRdPtrPd.mir @@ -17,8 +17,8 @@ body: | ; CHECK-LABEL: test_ldwrdptrpd - ; CHECK: early-clobber %r1, early-clobber %r31r30 = LDRdPtrPd killed %r31r30 - ; CHECK-NEXT: early-clobber %r0, early-clobber %r31r30 = LDRdPtrPd killed %r31r30 + ; CHECK: early-clobber %r1, %r31r30 = LDRdPtrPd killed %r31r30 + ; CHECK-NEXT: early-clobber %r0, %r31r30 = LDRdPtrPd killed %r31r30 %r1r0, %r31r30 = LDWRdPtrPd %r31r30 ... diff --git a/test/CodeGen/AVR/pseudo/LDWRdPtrPi.mir b/test/CodeGen/AVR/pseudo/LDWRdPtrPi.mir index 50bad2a4c765..a947d48d0bad 100644 --- a/test/CodeGen/AVR/pseudo/LDWRdPtrPi.mir +++ b/test/CodeGen/AVR/pseudo/LDWRdPtrPi.mir @@ -17,8 +17,8 @@ body: | ; CHECK-LABEL: test_ldwrdptrpi - ; CHECK: early-clobber %r0, early-clobber %r31r30 = LDRdPtrPi killed %r31r30 - ; CHECK-NEXT: early-clobber %r1, early-clobber %r31r30 = LDRdPtrPi killed %r31r30 + ; CHECK: early-clobber %r0, %r31r30 = LDRdPtrPi killed %r31r30 + ; CHECK-NEXT: early-clobber %r1, %r31r30 = LDRdPtrPi killed %r31r30 %r1r0, %r31r30 = LDWRdPtrPi %r31r30 ... diff --git a/test/CodeGen/AVR/std-ldd-immediate-overflow.ll b/test/CodeGen/AVR/std-ldd-immediate-overflow.ll new file mode 100644 index 000000000000..290e349c5342 --- /dev/null +++ b/test/CodeGen/AVR/std-ldd-immediate-overflow.ll @@ -0,0 +1,18 @@ +; RUN: llc -O0 < %s -march=avr | FileCheck %s + +define i32 @std_ldd_overflow() { + %src = alloca [4 x i8] + %dst = alloca [4 x i8] + %buf = alloca [28 x i16] + %1 = bitcast [4 x i8]* %src to i32* + store i32 0, i32 *%1 + %2 = bitcast [4 x i8]* %dst to i8* + %3 = bitcast [4 x i8]* %src to i8* + call void @llvm.memcpy.p0i8.p0i8.i16(i8* %2, i8* %3, i16 4, i32 1, i1 false) +; CHECK-NOT: std {{[XYZ]}}+64, {{r[0-9]+}} +; CHECK-NOT: ldd {{r[0-9]+}}, {{[XYZ]}}+64 + + ret i32 0 +} + +declare void @llvm.memcpy.p0i8.p0i8.i16(i8* nocapture writeonly, i8* nocapture readonly, i16, i32, i1) diff --git a/test/CodeGen/AVR/varargs.ll b/test/CodeGen/AVR/varargs.ll index 6f727cda582d..7224ac3f2b8d 100644 --- a/test/CodeGen/AVR/varargs.ll +++ b/test/CodeGen/AVR/varargs.ll @@ -27,8 +27,8 @@ define i16 @varargs1(i8* nocapture %x, ...) { define i16 @varargs2(i8* nocapture %x, ...) { ; CHECK-LABEL: varargs2: -; CHECK: ld r24, Z -; CHECK: ldd r25, Z+1 +; CHECK: ldd r24, [[REG:X|Y|Z]]+{{[0-9]+}} +; CHECK: ldd r25, [[REG]]+{{[0-9]+}} %ap = alloca i8* %ap1 = bitcast i8** %ap to i8* call void @llvm.va_start(i8* %ap1) diff --git a/test/CodeGen/Mips/dsp-spill-reload.ll b/test/CodeGen/Mips/dsp-spill-reload.ll new file mode 100644 index 000000000000..871a45017158 --- /dev/null +++ b/test/CodeGen/Mips/dsp-spill-reload.ll @@ -0,0 +1,52 @@ +; RUN: llc -march=mips -mattr=+dsp < %s -asm-show-inst -O0 | FileCheck %s \ +; RUN: --check-prefixes=ASM,ALL +; RUN: llc -march=mips -mattr=+dsp,+micromips < %s -O0 -filetype=obj | \ +; RUN: llvm-objdump -d - | FileCheck %s --check-prefixes=MM-OBJ,ALL + +; Test that spill and reloads use the dsp "variant" instructions. We use -O0 +; to use the simple register allocator. + +; To test the micromips output, we have to take a round trip through the +; object file encoder/decoder as the instruction mapping tables are used to +; support micromips. + +; FIXME: We should be able to get rid of those instructions with the variable +; value registers. + +; ALL-LABEL: spill_reload: + +define <4 x i8> @spill_reload(<4 x i8> %a, <4 x i8> %b, i32 %g) { +entry: + %c = tail call <4 x i8> @llvm.mips.addu.qb(<4 x i8> %a, <4 x i8> %b) + %cond = icmp eq i32 %g, 0 + br i1 %cond, label %true, label %end + +; ASM: SWDSP +; ASM: SWDSP +; ASM: SWDSP + +; MM-OBJ: sw ${{[0-9]+}}, {{[0-9]+}}($sp) +; MM-OBJ: sw ${{[0-9]+}}, {{[0-9]+}}($sp) +; MM-OBJ: sw ${{[0-9]+}}, {{[0-9]+}}($sp) +; MM-OBJ: sw ${{[0-9]+}}, {{[0-9]+}}($sp) + +true: + ret <4 x i8> %c + +; ASM: LWDSP + +; MM-OBJ: lw ${{[0-9]+}}, {{[0-9]+}}($sp) + +end: + %d = tail call <4 x i8> @llvm.mips.addu.qb(<4 x i8> %c, <4 x i8> %a) + ret <4 x i8> %d + +; ASM: LWDSP +; ASM: LWDSP + +; MM-OBJ: lw ${{[0-9]+}}, {{[0-9]+}}($sp) +; MM-OBJ: lw ${{[0-9]+}}, {{[0-9]+}}($sp) + +} + +declare <4 x i8> @llvm.mips.addu.qb(<4 x i8>, <4 x i8>) nounwind diff --git a/test/CodeGen/Mips/msa/emergency-spill.mir b/test/CodeGen/Mips/msa/emergency-spill.mir new file mode 100644 index 000000000000..a53368e0342a --- /dev/null +++ b/test/CodeGen/Mips/msa/emergency-spill.mir @@ -0,0 +1,212 @@ +# RUN: llc %s -start-after=shrink-wrap -march=mips64 -mcpu=mips64r6 -mattr=+fp64,+msa -o /dev/null + +# Test that estimated size of the stack leads to the creation of an emergency +# spill when MSA is in use. Previously, this test case would fail during +# register scavenging due to the lack of a spill slot. +--- | + define inreg { i64, i64 } @test(i64 inreg %a.coerce0, i64 inreg %a.coerce1, i64 inreg %b.coerce0, i64 inreg %b.coerce1, i32 signext %c) #0 { + entry: + %retval = alloca <16 x i8>, align 16 + %a = alloca <16 x i8>, align 16 + %b = alloca <16 x i8>, align 16 + %a.addr = alloca <16 x i8>, align 16 + %b.addr = alloca <16 x i8>, align 16 + %c.addr = alloca i32, align 4 + %g = alloca <16 x i8>*, align 8 + %d = alloca i8*, align 8 + %0 = bitcast <16 x i8>* %a to { i64, i64 }* + %1 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %0, i32 0, i32 0 + store i64 %a.coerce0, i64* %1, align 16 + %2 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %0, i32 0, i32 1 + store i64 %a.coerce1, i64* %2, align 8 + %a1 = load <16 x i8>, <16 x i8>* %a, align 16 + %3 = bitcast <16 x i8>* %b to { i64, i64 }* + %4 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 0 + store i64 %b.coerce0, i64* %4, align 16 + %5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 1 + store i64 %b.coerce1, i64* %5, align 8 + %b2 = load <16 x i8>, <16 x i8>* %b, align 16 + store <16 x i8> %a1, <16 x i8>* %a.addr, align 16 + store <16 x i8> %b2, <16 x i8>* %b.addr, align 16 + store i32 %c, i32* %c.addr, align 4 + %6 = alloca i8, i64 6400, align 16 + %7 = bitcast i8* %6 to <16 x i8>* + store <16 x i8>* %7, <16 x i8>** %g, align 8 + %8 = load <16 x i8>*, <16 x i8>** %g, align 8 + call void @h(<16 x i8>* %b.addr, <16 x i8>* %8) + %9 = load <16 x i8>*, <16 x i8>** %g, align 8 + %10 = bitcast <16 x i8>* %9 to i8* + store i8* %10, i8** %d, align 8 + %11 = load <16 x i8>, <16 x i8>* %a.addr, align 16 + %12 = load i8*, i8** %d, align 8 + %arrayidx = getelementptr inbounds i8, i8* %12, i64 0 + %13 = load i8, i8* %arrayidx, align 1 + %conv = sext i8 %13 to i32 + %14 = call <16 x i8> @llvm.mips.fill.b(i32 %conv) + %add = add <16 x i8> %11, %14 + %15 = load i8*, i8** %d, align 8 + %arrayidx3 = getelementptr inbounds i8, i8* %15, i64 1 + %16 = load i8, i8* %arrayidx3, align 1 + %conv4 = sext i8 %16 to i32 + %17 = call <16 x i8> @llvm.mips.fill.b(i32 %conv4) + %add5 = add <16 x i8> %add, %17 + %18 = load <16 x i8>, <16 x i8>* %b.addr, align 16 + %add6 = add <16 x i8> %18, %add5 + store <16 x i8> %add6, <16 x i8>* %b.addr, align 16 + %19 = load <16 x i8>, <16 x i8>* %b.addr, align 16 + store <16 x i8> %19, <16 x i8>* %retval, align 16 + %20 = bitcast <16 x i8>* %retval to { i64, i64 }* + %21 = load { i64, i64 }, { i64, i64 }* %20, align 16 + ret { i64, i64 } %21 + } + + declare void @h(<16 x i8>*, <16 x i8>*) + + declare <16 x i8> @llvm.mips.fill.b(i32) + + declare void @llvm.stackprotector(i8*, i8**) + +... +--- +name: test +alignment: 3 +exposesReturnsTwice: false +legalized: false +regBankSelected: false +selected: false +tracksRegLiveness: true +registers: +liveins: + - { reg: '%a0_64', virtual-reg: '' } + - { reg: '%a1_64', virtual-reg: '' } + - { reg: '%a2_64', virtual-reg: '' } + - { reg: '%a3_64', virtual-reg: '' } + - { reg: '%t0_64', virtual-reg: '' } +frameInfo: + isFrameAddressTaken: false + isReturnAddressTaken: false + hasStackMap: false + hasPatchPoint: false + stackSize: 0 + offsetAdjustment: 0 + maxAlignment: 16 + adjustsStack: false + hasCalls: true + stackProtector: '' + maxCallFrameSize: 4294967295 + hasOpaqueSPAdjustment: false + hasVAStart: false + hasMustTailInVarArgFunc: false + savePoint: '' + restorePoint: '' +fixedStack: +stack: + - { id: 0, name: retval, type: default, offset: 0, size: 16, alignment: 16, + callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + - { id: 1, name: a, type: default, offset: 0, size: 16, alignment: 16, + callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + - { id: 2, name: b, type: default, offset: 0, size: 16, alignment: 16, + callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + - { id: 3, name: a.addr, type: default, offset: 0, size: 16, alignment: 16, + callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + - { id: 4, name: b.addr, type: default, offset: 0, size: 16, alignment: 16, + callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + - { id: 5, name: c.addr, type: default, offset: 0, size: 4, alignment: 4, + callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + - { id: 6, name: g, type: default, offset: 0, size: 8, alignment: 8, + callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + - { id: 7, name: d, type: default, offset: 0, size: 8, alignment: 8, + callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + - { id: 8, name: '', type: default, offset: 0, size: 6400, + alignment: 16, callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } +constants: +body: | + bb.0.entry: + liveins: %a0_64, %a1_64, %a2_64, %a3_64, %t0_64 + + SD killed %a0_64, %stack.1.a, 0 :: (store 8 into %ir.1, align 16) + SD killed %a1_64, %stack.1.a, 8 :: (store 8 into %ir.2) + %w0 = LD_B %stack.1.a, 0 :: (dereferenceable load 16 from %ir.a) + SD killed %a2_64, %stack.2.b, 0 :: (store 8 into %ir.4, align 16) + SD killed %a3_64, %stack.2.b, 8 :: (store 8 into %ir.5) + %w1 = LD_B %stack.2.b, 0 :: (dereferenceable load 16 from %ir.b) + ST_B killed %w0, %stack.3.a.addr, 0 :: (store 16 into %ir.a.addr) + ST_B killed %w1, %stack.4.b.addr, 0 :: (store 16 into %ir.b.addr) + SW %t0, %stack.5.c.addr, 0, implicit killed %t0_64 :: (store 4 into %ir.c.addr) + %at_64 = LEA_ADDiu64 %stack.8, 0 + SD killed %at_64, %stack.6.g, 0 :: (store 8 into %ir.g) + %a1_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + ADJCALLSTACKDOWN 0, 0, implicit-def dead %sp, implicit %sp + %a0_64 = LEA_ADDiu64 %stack.4.b.addr, 0 + JAL @h, csr_n64, implicit-def dead %ra, implicit %a0_64, implicit %a1_64, implicit-def %sp + ADJCALLSTACKUP 0, 0, implicit-def dead %sp, implicit %sp + %at_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %v0_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %v1_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %a0_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %a1_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %a2_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %a3_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t0_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t1_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t2_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t3_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t4_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t5_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t6_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t7_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %s0_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %s1_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %s2_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %s3_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %s4_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %s5_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %s6_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %s7_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t8_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %t9_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %ra_64 = LD %stack.6.g, 0 :: (dereferenceable load 8 from %ir.g) + %w0 = LD_B %stack.3.a.addr, 0 :: (dereferenceable load 16 from %ir.a.addr) + SD %at_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %v0_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %v1_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %a0_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %a1_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %a2_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %a3_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t0_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t1_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t2_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t3_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t4_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t5_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t6_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t7_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %s0_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %s1_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %s2_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %s3_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %s4_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %s5_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %s6_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %s7_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t8_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %t9_64, %stack.7.d, 0 :: (store 8 into %ir.d) + SD %ra_64, %stack.7.d, 0 :: (store 8 into %ir.d) + %at_64 = LD %stack.7.d, 0 :: (dereferenceable load 8 from %ir.d) + %v0 = LB %at_64, 0 :: (load 1 from %ir.arrayidx) + %w1 = FILL_B killed %v0 + %w0 = ADDV_B killed %w0, killed %w1 + %at = LB killed %at_64, 1 :: (load 1 from %ir.arrayidx3) + %w1 = FILL_B killed %at + %w0 = ADDV_B killed %w0, killed %w1 + %w1 = LD_B %stack.4.b.addr, 0 :: (dereferenceable load 16 from %ir.b.addr) + %w0 = ADDV_B killed %w1, killed %w0 + ST_B killed %w0, %stack.4.b.addr, 0 :: (store 16 into %ir.b.addr) + %w0 = LD_B %stack.4.b.addr, 0 :: (dereferenceable load 16 from %ir.b.addr) + ST_B killed %w0, %stack.0.retval, 0 :: (store 16 into %ir.retval) + %v0_64 = LD %stack.0.retval, 0 :: (dereferenceable load 8 from %ir.20, align 16) + %v1_64 = LD %stack.0.retval, 8 :: (dereferenceable load 8 from %ir.20 + 8, align 16) + RetRA implicit %v0_64, implicit %v1_64 + +... diff --git a/test/CodeGen/Mips/msa/frameindex.ll b/test/CodeGen/Mips/msa/frameindex.ll index f903381f9ef0..9c2228d3bf63 100644 --- a/test/CodeGen/Mips/msa/frameindex.ll +++ b/test/CodeGen/Mips/msa/frameindex.ll @@ -18,7 +18,8 @@ define void @loadstore_v16i8_just_under_simm10() nounwind { ; MIPS32-AE: loadstore_v16i8_just_under_simm10: %1 = alloca <16 x i8> - %2 = alloca [496 x i8] ; Push the frame right up to 512 bytes + %2 = alloca [492 x i8] ; Push the frame--acounting for the emergency spill + ; slot--right up to 512 bytes %3 = load volatile <16 x i8>, <16 x i8>* %1 ; MIPS32-AE: ld.b [[R1:\$w[0-9]+]], 496($sp) @@ -33,7 +34,8 @@ define void @loadstore_v16i8_just_over_simm10() nounwind { ; MIPS32-AE: loadstore_v16i8_just_over_simm10: %1 = alloca <16 x i8> - %2 = alloca [497 x i8] ; Push the frame just over 512 bytes + %2 = alloca [497 x i8] ; Push the frame--acounting for the emergency spill + ; slot--right up to 512 bytes %3 = load volatile <16 x i8>, <16 x i8>* %1 ; MIPS32-AE: addiu [[BASE:\$([0-9]+|gp)]], $sp, 512 @@ -50,7 +52,8 @@ define void @loadstore_v16i8_just_under_simm16() nounwind { ; MIPS32-AE: loadstore_v16i8_just_under_simm16: %1 = alloca <16 x i8> - %2 = alloca [32752 x i8] ; Push the frame right up to 32768 bytes + %2 = alloca [32752 x i8] ; Push the frame--acounting for the emergency spill + ; slot--right up to 32768 bytes %3 = load volatile <16 x i8>, <16 x i8>* %1 ; MIPS32-AE: ori [[R2:\$([0-9]+|gp)]], $zero, 32768 @@ -69,7 +72,8 @@ define void @loadstore_v16i8_just_over_simm16() nounwind { ; MIPS32-AE: loadstore_v16i8_just_over_simm16: %1 = alloca <16 x i8> - %2 = alloca [32753 x i8] ; Push the frame just over 32768 bytes + %2 = alloca [32753 x i8] ; Push the frame--acounting for the emergency spill + ; slot--just over 32768 bytes %3 = load volatile <16 x i8>, <16 x i8>* %1 ; MIPS32-AE: ori [[R2:\$([0-9]+|gp)]], $zero, 32768 @@ -121,7 +125,8 @@ define void @loadstore_v8i16_just_under_simm10() nounwind { ; MIPS32-AE: loadstore_v8i16_just_under_simm10: %1 = alloca <8 x i16> - %2 = alloca [1008 x i8] ; Push the frame right up to 1024 bytes + %2 = alloca [1004 x i8] ; Push the frame--acounting for the emergency spill + ; slot--right up to 1024 bytes %3 = load volatile <8 x i16>, <8 x i16>* %1 ; MIPS32-AE: ld.h [[R1:\$w[0-9]+]], 1008($sp) @@ -136,7 +141,8 @@ define void @loadstore_v8i16_just_over_simm10() nounwind { ; MIPS32-AE: loadstore_v8i16_just_over_simm10: %1 = alloca <8 x i16> - %2 = alloca [1009 x i8] ; Push the frame just over 1024 bytes + %2 = alloca [1009 x i8] ; Push the frame--acounting for the emergency spill + ; slot--just over 1024 bytes %3 = load volatile <8 x i16>, <8 x i16>* %1 ; MIPS32-AE: addiu [[BASE:\$([0-9]+|gp)]], $sp, 1024 @@ -153,7 +159,8 @@ define void @loadstore_v8i16_just_under_simm16() nounwind { ; MIPS32-AE: loadstore_v8i16_just_under_simm16: %1 = alloca <8 x i16> - %2 = alloca [32752 x i8] ; Push the frame right up to 32768 bytes + %2 = alloca [32752 x i8] ; Push the frame--acounting for the emergency spill + ; slot--right up to 32768 bytes %3 = load volatile <8 x i16>, <8 x i16>* %1 ; MIPS32-AE: ori [[R2:\$([0-9]+|gp)]], $zero, 32768 @@ -172,7 +179,8 @@ define void @loadstore_v8i16_just_over_simm16() nounwind { ; MIPS32-AE: loadstore_v8i16_just_over_simm16: %1 = alloca <8 x i16> - %2 = alloca [32753 x i8] ; Push the frame just over 32768 bytes + %2 = alloca [32753 x i8] ; Push the frame--acounting for the emergency spill + ; slot--just over 32768 bytes %3 = load volatile <8 x i16>, <8 x i16>* %1 ; MIPS32-AE: ori [[R2:\$([0-9]+|gp)]], $zero, 32768 @@ -224,7 +232,8 @@ define void @loadstore_v4i32_just_under_simm10() nounwind { ; MIPS32-AE: loadstore_v4i32_just_under_simm10: %1 = alloca <4 x i32> - %2 = alloca [2032 x i8] ; Push the frame right up to 2048 bytes + %2 = alloca [2028 x i8] ; Push the frame--acounting for the emergency spill + ; slot--right up to 2048 bytes %3 = load volatile <4 x i32>, <4 x i32>* %1 ; MIPS32-AE: ld.w [[R1:\$w[0-9]+]], 2032($sp) @@ -239,7 +248,8 @@ define void @loadstore_v4i32_just_over_simm10() nounwind { ; MIPS32-AE: loadstore_v4i32_just_over_simm10: %1 = alloca <4 x i32> - %2 = alloca [2033 x i8] ; Push the frame just over 2048 bytes + %2 = alloca [2033 x i8] ; Push the frame--acounting for the emergency spill + ; slot--just over 2048 bytes %3 = load volatile <4 x i32>, <4 x i32>* %1 ; MIPS32-AE: addiu [[BASE:\$([0-9]+|gp)]], $sp, 2048 @@ -256,7 +266,8 @@ define void @loadstore_v4i32_just_under_simm16() nounwind { ; MIPS32-AE: loadstore_v4i32_just_under_simm16: %1 = alloca <4 x i32> - %2 = alloca [32752 x i8] ; Push the frame right up to 32768 bytes + %2 = alloca [32752 x i8] ; Push the frame--acounting for the emergency spill + ; slot-- right up to 32768 bytes %3 = load volatile <4 x i32>, <4 x i32>* %1 ; MIPS32-AE: ori [[R2:\$([0-9]+|gp)]], $zero, 32768 @@ -275,7 +286,8 @@ define void @loadstore_v4i32_just_over_simm16() nounwind { ; MIPS32-AE: loadstore_v4i32_just_over_simm16: %1 = alloca <4 x i32> - %2 = alloca [32753 x i8] ; Push the frame just over 32768 bytes + %2 = alloca [32753 x i8] ; Push the frame--acounting for the emergency spill + ; slot--just over 32768 bytes %3 = load volatile <4 x i32>, <4 x i32>* %1 ; MIPS32-AE: ori [[R2:\$([0-9]+|gp)]], $zero, 32768 @@ -327,8 +339,8 @@ define void @loadstore_v2i64_just_under_simm10() nounwind { ; MIPS32-AE: loadstore_v2i64_just_under_simm10: %1 = alloca <2 x i64> - %2 = alloca [4080 x i8] ; Push the frame right up to 4096 bytes - + %2 = alloca [4076 x i8] ; Push the frame--acounting for the emergency spill + ; slot--right up to 4096 bytes %3 = load volatile <2 x i64>, <2 x i64>* %1 ; MIPS32-AE: ld.d [[R1:\$w[0-9]+]], 4080($sp) store volatile <2 x i64> %3, <2 x i64>* %1 @@ -342,7 +354,8 @@ define void @loadstore_v2i64_just_over_simm10() nounwind { ; MIPS32-AE: loadstore_v2i64_just_over_simm10: %1 = alloca <2 x i64> - %2 = alloca [4081 x i8] ; Push the frame just over 4096 bytes + %2 = alloca [4081 x i8] ; Push the frame--acounting for the emergency spill + ; slot--just over 4096 bytes %3 = load volatile <2 x i64>, <2 x i64>* %1 ; MIPS32-AE: addiu [[BASE:\$([0-9]+|gp)]], $sp, 4096 @@ -359,7 +372,8 @@ define void @loadstore_v2i64_just_under_simm16() nounwind { ; MIPS32-AE: loadstore_v2i64_just_under_simm16: %1 = alloca <2 x i64> - %2 = alloca [32752 x i8] ; Push the frame right up to 32768 bytes + %2 = alloca [32752 x i8] ; Push the frame--acounting for the emergency spill + ; slot--right up to 32768 bytes %3 = load volatile <2 x i64>, <2 x i64>* %1 ; MIPS32-AE: ori [[R2:\$([0-9]+|gp)]], $zero, 32768 @@ -378,7 +392,8 @@ define void @loadstore_v2i64_just_over_simm16() nounwind { ; MIPS32-AE: loadstore_v2i64_just_over_simm16: %1 = alloca <2 x i64> - %2 = alloca [32753 x i8] ; Push the frame just over 32768 bytes + %2 = alloca [32753 x i8] ; Push the frame--acounting for the emergency spill + ; slot--just over 32768 bytes %3 = load volatile <2 x i64>, <2 x i64>* %1 ; MIPS32-AE: ori [[R2:\$([0-9]+|gp)]], $zero, 32768 diff --git a/test/CodeGen/X86/fp128-cast.ll b/test/CodeGen/X86/fp128-cast.ll index 6543292c08b4..560892485d89 100644 --- a/test/CodeGen/X86/fp128-cast.ll +++ b/test/CodeGen/X86/fp128-cast.ll @@ -1,5 +1,7 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx | FileCheck %s --check-prefix=X64 ; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx | FileCheck %s --check-prefix=X64 +; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=-mmx | FileCheck %s --check-prefix=X64_NO_MMX ; RUN: llc < %s -O2 -mtriple=i686-linux-gnu -mattr=+mmx | FileCheck %s --check-prefix=X32 ; Check soft floating point conversion function calls. @@ -359,6 +361,69 @@ cleanup: ; preds = %entry, %if.then ; X64: retq } +define i1 @PR34866(i128 %x) { +; X64-LABEL: PR34866: +; X64: # BB#0: +; X64-NEXT: movaps {{.*}}(%rip), %xmm0 +; X64-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp) +; X64-NEXT: xorq -{{[0-9]+}}(%rsp), %rsi +; X64-NEXT: xorq -{{[0-9]+}}(%rsp), %rdi +; X64-NEXT: orq %rsi, %rdi +; X64-NEXT: sete %al +; X64-NEXT: retq +; +; X64_NO_MMX-LABEL: PR34866: +; X64_NO_MMX: # BB#0: +; X64_NO_MMX-NEXT: orq %rsi, %rdi +; X64_NO_MMX-NEXT: sete %al +; X64_NO_MMX-NEXT: retq +; +; X32-LABEL: PR34866: +; X32: # BB#0: +; X32-NEXT: movl {{[0-9]+}}(%esp), %eax +; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X32-NEXT: orl {{[0-9]+}}(%esp), %ecx +; X32-NEXT: orl {{[0-9]+}}(%esp), %eax +; X32-NEXT: orl %ecx, %eax +; X32-NEXT: sete %al +; X32-NEXT: retl + %bc_mmx = bitcast fp128 0xL00000000000000000000000000000000 to i128 + %cmp = icmp eq i128 %bc_mmx, %x + ret i1 %cmp +} + +define i1 @PR34866_commute(i128 %x) { +; X64-LABEL: PR34866_commute: +; X64: # BB#0: +; X64-NEXT: movaps {{.*}}(%rip), %xmm0 +; X64-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp) +; X64-NEXT: xorq -{{[0-9]+}}(%rsp), %rsi +; X64-NEXT: xorq -{{[0-9]+}}(%rsp), %rdi +; X64-NEXT: orq %rsi, %rdi +; X64-NEXT: sete %al +; X64-NEXT: retq +; +; X64_NO_MMX-LABEL: PR34866_commute: +; X64_NO_MMX: # BB#0: +; X64_NO_MMX-NEXT: orq %rsi, %rdi +; X64_NO_MMX-NEXT: sete %al +; X64_NO_MMX-NEXT: retq +; +; X32-LABEL: PR34866_commute: +; X32: # BB#0: +; X32-NEXT: movl {{[0-9]+}}(%esp), %eax +; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X32-NEXT: orl {{[0-9]+}}(%esp), %ecx +; X32-NEXT: orl {{[0-9]+}}(%esp), %eax +; X32-NEXT: orl %ecx, %eax +; X32-NEXT: sete %al +; X32-NEXT: retl + %bc_mmx = bitcast fp128 0xL00000000000000000000000000000000 to i128 + %cmp = icmp eq i128 %x, %bc_mmx + ret i1 %cmp +} + + declare double @copysign(double, double) #1 attributes #2 = { nounwind readnone } diff --git a/test/CodeGen/X86/pr34605.ll b/test/CodeGen/X86/pr34605.ll new file mode 100644 index 000000000000..8330511d6449 --- /dev/null +++ b/test/CodeGen/X86/pr34605.ll @@ -0,0 +1,63 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=avx512bw,avx512vl,avx512dq | FileCheck %s + +define void @pr34605(i8* nocapture %s, i32 %p) { +; CHECK-LABEL: pr34605: +; CHECK: # BB#0: # %entry +; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax +; CHECK-NEXT: vpbroadcastd {{[0-9]+}}(%esp), %zmm0 +; CHECK-NEXT: vpcmpeqd {{\.LCPI.*}}, %zmm0, %k0 +; CHECK-NEXT: vpcmpeqd {{\.LCPI.*}}, %zmm0, %k1 +; CHECK-NEXT: kunpckwd %k0, %k1, %k0 +; CHECK-NEXT: vpcmpeqd {{\.LCPI.*}}, %zmm0, %k1 +; CHECK-NEXT: vpcmpeqd {{\.LCPI.*}}, %zmm0, %k2 +; CHECK-NEXT: kunpckwd %k1, %k2, %k1 +; CHECK-NEXT: kunpckdq %k0, %k1, %k0 +; CHECK-NEXT: kxord %k0, %k0, %k1 +; CHECK-NEXT: movl $1, %ecx +; CHECK-NEXT: kmovd %ecx, %k2 +; CHECK-NEXT: kunpckdq %k2, %k1, %k1 +; CHECK-NEXT: kandq %k1, %k0, %k1 +; CHECK-NEXT: vmovdqu8 {{\.LCPI.*}}, %zmm0 {%k1} {z} +; CHECK-NEXT: vmovdqu8 %zmm0, (%eax) +; CHECK-NEXT: vpxord %zmm0, %zmm0, %zmm0 +; CHECK-NEXT: vmovdqu32 %zmm0, 64(%eax) +; CHECK-NEXT: vmovdqu32 %zmm0, 128(%eax) +; CHECK-NEXT: vmovdqu32 %zmm0, 192(%eax) +; CHECK-NEXT: vmovdqu32 %zmm0, 256(%eax) +; CHECK-NEXT: vmovdqu32 %zmm0, 320(%eax) +; CHECK-NEXT: vmovdqu32 %zmm0, 384(%eax) +; CHECK-NEXT: vmovdqu32 %zmm0, 448(%eax) +; CHECK-NEXT: vzeroupper +; CHECK-NEXT: retl +entry: + %broadcast.splatinsert = insertelement <64 x i32> undef, i32 %p, i32 0 + %broadcast.splat = shufflevector <64 x i32> %broadcast.splatinsert, <64 x i32> undef, <64 x i32> zeroinitializer + %0 = icmp eq <64 x i32> %broadcast.splat, + %1 = and <64 x i1> %0, + %2 = zext <64 x i1> %1 to <64 x i8> + %3 = bitcast i8* %s to <64 x i8>* + store <64 x i8> %2, <64 x i8>* %3, align 1 + %4 = getelementptr inbounds i8, i8* %s, i32 64 + %5 = bitcast i8* %4 to <64 x i8>* + store <64 x i8> zeroinitializer, <64 x i8>* %5, align 1 + %6 = getelementptr inbounds i8, i8* %s, i32 128 + %7 = bitcast i8* %6 to <64 x i8>* + store <64 x i8> zeroinitializer, <64 x i8>* %7, align 1 + %8 = getelementptr inbounds i8, i8* %s, i32 192 + %9 = bitcast i8* %8 to <64 x i8>* + store <64 x i8> zeroinitializer, <64 x i8>* %9, align 1 + %10 = getelementptr inbounds i8, i8* %s, i32 256 + %11 = bitcast i8* %10 to <64 x i8>* + store <64 x i8> zeroinitializer, <64 x i8>* %11, align 1 + %12 = getelementptr inbounds i8, i8* %s, i32 320 + %13 = bitcast i8* %12 to <64 x i8>* + store <64 x i8> zeroinitializer, <64 x i8>* %13, align 1 + %14 = getelementptr inbounds i8, i8* %s, i32 384 + %15 = bitcast i8* %14 to <64 x i8>* + store <64 x i8> zeroinitializer, <64 x i8>* %15, align 1 + %16 = getelementptr inbounds i8, i8* %s, i32 448 + %17 = bitcast i8* %16 to <64 x i8>* + store <64 x i8> zeroinitializer, <64 x i8>* %17, align 1 + ret void +} diff --git a/test/DebugInfo/Sparc/subreg.ll b/test/DebugInfo/Sparc/subreg.ll new file mode 100644 index 000000000000..74475c5b0f22 --- /dev/null +++ b/test/DebugInfo/Sparc/subreg.ll @@ -0,0 +1,35 @@ +; RUN: llc -filetype=obj -O0 < %s -mtriple sparc64-unknown-linux-gnu | llvm-dwarfdump - | FileCheck %s +; The undescribable 128-bit register should be split into two 64-bit registers. +; CHECK: Location description: 90 48 93 08 90 49 93 08 +; DW_OP_reg74 DW_OP_piece 8 DW_OP_reg75 DW_OP_piece 8 ... + +target datalayout = "E-m:e-i64:64-n32:64-S128" +target triple = "sparc64" + +; Function Attrs: nounwind readnone +define void @fn1(fp128 %b) local_unnamed_addr !dbg !7 { +entry: + tail call void @llvm.dbg.value(metadata fp128 %b, i64 0, metadata !13, metadata !18), !dbg !17 + tail call void @llvm.dbg.value(metadata fp128 0xL00000000000000000000000000000000, i64 0, metadata !13, metadata !19), !dbg !17 + ret void, !dbg !20 +} + +; Function Attrs: nounwind readnone speculatable +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!4} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, emissionKind: FullDebug) +!1 = !DIFile(filename: "subreg.c", directory: ".") +!4 = !{i32 2, !"Debug Info Version", i32 3} +!7 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 1, type: !8, unit: !0) +!8 = !DISubroutineType(types: !9) +!9 = !{null, !10} +!10 = !DIBasicType(name: "long double", size: 128, encoding: DW_ATE_float) +!13 = !DILocalVariable(name: "a", scope: !7, file: !1, line: 1, type: !14) +!14 = !DIBasicType(name: "complex", size: 256, encoding: DW_ATE_complex_float) +!17 = !DILocation(line: 1, column: 48, scope: !7) +!18 = !DIExpression(DW_OP_LLVM_fragment, 0, 128) +!19 = !DIExpression(DW_OP_LLVM_fragment, 128, 128) +!20 = !DILocation(line: 1, column: 55, scope: !7) diff --git a/test/DebugInfo/cross-cu-scope.ll b/test/DebugInfo/cross-cu-scope.ll new file mode 100644 index 000000000000..7c71f2769eb7 --- /dev/null +++ b/test/DebugInfo/cross-cu-scope.ll @@ -0,0 +1,50 @@ +; RUN: %llc_dwarf %s -filetype=obj -o %t +; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s + +; Reduced test case from PR35212. Two DISubprogram belong to a different CU but +; share a scope. Both are declarations and end up in the scope's CU. We want to +; check that the CU from the context DIE is used (rather than from the IR). +; This manifests itself by the DW_base_type ending up in the second CU, rather +; than in the first one as specified in the IR. + +; CHECK: DW_TAG_compile_unit +; CHECK-NEXT: discriminator 0 +; CHECK: DW_TAG_compile_unit +; CHECK-NEXT: discriminator 1 +; CHECK: DW_TAG_structure_type +; CHECK-NOT: NULL +; CHECK: DW_TAG_subprogram +; CHECK-NOT: NULL +; CHECK: DW_TAG_formal_parameter +; CHECK-NOT: NULL +; CHECK: DW_AT_type{{.*}}{[[USIZE_LABEL:0x[0-9a-f]+]]} +; CHECK: NULL +; CHECK: [[USIZE_LABEL]]: DW_TAG_base_type +; CHECK-NOT: NULL +; CHECK: DW_AT_name{{.*}}"usize" + +define hidden void @foo() !dbg !4 { + ret void, !dbg !7 +} + +!llvm.dbg.cu = !{!0, !2} +!llvm.module.flags = !{!3} + +!0 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !1, producer: "clang LLVM (rustc version 1.23.0-nightly (discriminator 0))", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) +!1 = !DIFile(filename: "../lib.rs", directory: "/home/alex/code/rust4/lol") +!2 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !1, producer: "clang LLVM (rustc version 1.23.0-nightly (discriminator 1))", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) +!3 = !{i32 2, !"Debug Info Version", i32 3} +!4 = distinct !DISubprogram(name: "clone", linkageName: "_ZN5alloc3vec8{{impl}}28cloneE", scope: null, file: !1, line: 1519, type: !5, isLocal: false, isDefinition: true, scopeLine: 1519, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !6, variables: !6) +!5 = !DISubroutineType(types: !6) +!6 = !{} +!7 = !DILocation(line: 1612, scope: !8, inlinedAt: !11) +!8 = distinct !DILexicalBlock(scope: !9, file: !1, line: 86, column: 12) +!9 = distinct !DISubprogram(name: "allocate_in", linkageName: "_ZN5alloc7raw_vec8{{impl}}52allocate_inE", scope: !10, file: !1, line: 82, type: !5, isLocal: false, isDefinition: true, scopeLine: 82, flags: DIFlagPrototyped, isOptimized: true, unit: !2, templateParams: !6, variables: !6) +!10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "RawVec", file: !1, size: 128, align: 64, elements: !6, identifier: "5c6e4db16d2c64555e40661d70c4d81e") +!11 = distinct !DILocation(line: 86, scope: !8, inlinedAt: !12) +!12 = distinct !DILocation(line: 141, scope: !13, inlinedAt: !17) +!13 = distinct !DISubprogram(name: "with_capacity", linkageName: "_ZN5alloc7raw_vec8{{impl}}36with_capacityE", scope: !10, file: !1, line: 140, type: !5, isLocal: false, isDefinition: true, scopeLine: 140, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !6, variables: !14) +!14 = !{!15} +!15 = !DILocalVariable(name: "cap", arg: 1, scope: !13, file: !1, line: 1, type: !16) +!16 = !DIBasicType(name: "usize", size: 64, encoding: DW_ATE_unsigned) +!17 = !DILocation(line: 1521, scope: !4) diff --git a/test/LTO/Resolution/X86/function-alias-non-prevailing.ll b/test/LTO/Resolution/X86/function-alias-non-prevailing.ll new file mode 100644 index 000000000000..ab2cefebb42b --- /dev/null +++ b/test/LTO/Resolution/X86/function-alias-non-prevailing.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as -o %t %s +; RUN: llvm-lto2 run %t -r %t,foo, -r %t,baz,p -o %t2 -save-temps +; RUN: llvm-dis -o - %t2.0.0.preopt.bc | FileCheck %s + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64--fuchsia" + +; CHECK: declare void @foo() +@foo = weak alias void(), void()* @bar + +define internal void @bar() { + ret void +} + +define void()* @baz() { + ret void()* @foo +} diff --git a/test/Linker/Inputs/only-needed-compiler-used.ll b/test/Linker/Inputs/only-needed-compiler-used.ll new file mode 100644 index 000000000000..6e837aa10215 --- /dev/null +++ b/test/Linker/Inputs/only-needed-compiler-used.ll @@ -0,0 +1,7 @@ +@used1 = global i8 4 +@used2 = global i32 123 + +@llvm.compiler.used = appending global [2 x i8*] [ + i8* @used1, + i8* bitcast (i32* @used2 to i8*) +], section "llvm.metadata" diff --git a/test/Linker/Inputs/only-needed-ctors.ll b/test/Linker/Inputs/only-needed-ctors.ll new file mode 100644 index 000000000000..d95f3711ef52 --- /dev/null +++ b/test/Linker/Inputs/only-needed-ctors.ll @@ -0,0 +1,20 @@ +define internal void @ctor1() { + call void @func1() + ret void +} + +define internal void @ctor2() { + ret void +} + +define void @func1() { + ret void +} + +define void @unused() { + ret void +} + +@llvm.global_ctors = appending global[2 x{i32, void() *, i8 * }] [ + {i32, void() *, i8 * } { i32 2, void() *@ctor1, i8 *null}, + {i32, void() *, i8 * } { i32 7, void() *@ctor2, i8 *null}] diff --git a/test/Linker/Inputs/only-needed-dtors.ll b/test/Linker/Inputs/only-needed-dtors.ll new file mode 100644 index 000000000000..31aaf7bb74e1 --- /dev/null +++ b/test/Linker/Inputs/only-needed-dtors.ll @@ -0,0 +1,20 @@ +define internal void @dtor1() { + call void @func1() + ret void +} + +define internal void @dtor2() { + ret void +} + +define void @func1() { + ret void +} + +define void @unused() { + ret void +} + +@llvm.global_dtors = appending global[2 x{i32, void() *, i8 * }] [ + {i32, void() *, i8 * } { i32 2, void() *@dtor1, i8 *null}, + {i32, void() *, i8 * } { i32 7, void() *@dtor2, i8 *null}] diff --git a/test/Linker/Inputs/only-needed-used.ll b/test/Linker/Inputs/only-needed-used.ll new file mode 100644 index 000000000000..9387a13d7280 --- /dev/null +++ b/test/Linker/Inputs/only-needed-used.ll @@ -0,0 +1,7 @@ +@used1 = global i8 4 +@used2 = global i32 123 + +@llvm.used = appending global [2 x i8*] [ + i8* @used1, + i8* bitcast (i32* @used2 to i8*) +], section "llvm.metadata" diff --git a/test/Linker/only-needed-compiler-used.ll b/test/Linker/only-needed-compiler-used.ll new file mode 100644 index 000000000000..b15178bda781 --- /dev/null +++ b/test/Linker/only-needed-compiler-used.ll @@ -0,0 +1,13 @@ +; RUN: llvm-link -S %s %p/Inputs/only-needed-compiler-used.ll | FileCheck %s --check-prefix=CHECK --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -internalize %s %p/Inputs/only-needed-compiler-used.ll | FileCheck %s --check-prefix=CHECK --check-prefix=INTERNALIZE +; RUN: llvm-link -S -only-needed %s %p/Inputs/only-needed-compiler-used.ll | FileCheck %s --check-prefix=CHECK --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-compiler-used.ll | FileCheck %s --check-prefix=CHECK --check-prefix=INTERNALIZE + +; Empty destination module! + + +; CHECK-DAG: @llvm.compiler.used = appending global [2 x i8*] [i8* @used1, i8* bitcast (i32* @used2 to i8*)], section "llvm.metadata" +; NO-INTERNALIZE-DAG: @used1 = global i8 4 +; INTERNALIZE-DAG: @used1 = internal global i8 4 +; NO-INTERNALIZE-DAG: @used2 = global i32 123 +; INTERNALIZE-DAG: @used2 = internal global i32 123 diff --git a/test/Linker/only-needed-ctors1.ll b/test/Linker/only-needed-ctors1.ll new file mode 100644 index 000000000000..fbc5683fba78 --- /dev/null +++ b/test/Linker/only-needed-ctors1.ll @@ -0,0 +1,15 @@ +; RUN: llvm-link -S %s %p/Inputs/only-needed-ctors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=LINK-ALL --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -internalize %s %p/Inputs/only-needed-ctors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=LINK_ALL --check-prefix=INTERNALIZE +; RUN: llvm-link -S -only-needed %s %p/Inputs/only-needed-ctors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=ONLY-NEEDED --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-ctors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=ONLY-NEEDED --check-prefix=INTERNALIZE + +; Empty destination module! + + +; CHECK: @llvm.global_ctors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 2, void ()* @ctor1, i8* null }, { i32, void ()*, i8* } { i32 7, void ()* @ctor2, i8* null }] +; CHECK: define internal void @ctor1() +; CHECK: define internal void @ctor2() +; NO-INTERNALIZE: define void @func1() +; INTERNALIZE: define internal void @func1() +; LINK-ALL: define {{(internal )?}}void @unused() +; ONLY-NEEDED-NOT: void @unused() diff --git a/test/Linker/only-needed-ctors2.ll b/test/Linker/only-needed-ctors2.ll new file mode 100644 index 000000000000..018cfc874207 --- /dev/null +++ b/test/Linker/only-needed-ctors2.ll @@ -0,0 +1,28 @@ +; RUN: llvm-link -S %s %p/Inputs/only-needed-ctors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=LINK-ALL --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -internalize %s %p/Inputs/only-needed-ctors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=LINK_ALL --check-prefix=INTERNALIZE +; RUN: llvm-link -S -only-needed %s %p/Inputs/only-needed-ctors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=ONLY-NEEDED --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-ctors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=ONLY-NEEDED --check-prefix=INTERNALIZE + +; Destination module: + +define void @foo() { + ret void +} + +define internal void @ctor1() { + ret void +} + +@llvm.global_ctors = appending global[1 x{i32, void() *, i8 * }] [ + {i32, void() *, i8 * } { i32 4, void() *@ctor1, i8 *null}] + + +; CHECK: @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 4, void ()* @ctor1, i8* null }, { i32, void ()*, i8* } { i32 2, void ()* @ctor1.2, i8* null }, { i32, void ()*, i8* } { i32 7, void ()* @ctor2, i8* null }] +; CHECK: define internal void @ctor1() +; CHECK: define void @foo() +; CHECK: define internal void @ctor1.{{[0-9]+}}() +; CHECK: define internal void @ctor2() +; NO-INTERNALIZE: define void @func1() +; INTERNALIZE: define internal void @func1() +; LINK-ALL: define {{(internal )?}}void @unused() +; ONLY-NEEDED-NOT: void @unused() diff --git a/test/Linker/only-needed-dtors1.ll b/test/Linker/only-needed-dtors1.ll new file mode 100644 index 000000000000..5f16ffc268d3 --- /dev/null +++ b/test/Linker/only-needed-dtors1.ll @@ -0,0 +1,15 @@ +; RUN: llvm-link -S %s %p/Inputs/only-needed-dtors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=LINK-ALL --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -internalize %s %p/Inputs/only-needed-dtors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=LINK_ALL --check-prefix=INTERNALIZE +; RUN: llvm-link -S -only-needed %s %p/Inputs/only-needed-dtors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=ONLY-NEEDED --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-dtors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=ONLY-NEEDED --check-prefix=INTERNALIZE + +; Empty destination module! + + +; CHECK: @llvm.global_dtors = appending global [2 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 2, void ()* @dtor1, i8* null }, { i32, void ()*, i8* } { i32 7, void ()* @dtor2, i8* null }] +; CHECK: define internal void @dtor1() +; CHECK: define internal void @dtor2() +; NO-INTERNALIZE: define void @func1() +; INTERNALIZE: define internal void @func1() +; LINK-ALL: define {{(internal )?}}void @unused() +; ONLY-NEEDED-NOT: void @unused() diff --git a/test/Linker/only-needed-dtors2.ll b/test/Linker/only-needed-dtors2.ll new file mode 100644 index 000000000000..ece442b0d316 --- /dev/null +++ b/test/Linker/only-needed-dtors2.ll @@ -0,0 +1,28 @@ +; RUN: llvm-link -S %s %p/Inputs/only-needed-dtors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=LINK-ALL --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -internalize %s %p/Inputs/only-needed-dtors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=LINK_ALL --check-prefix=INTERNALIZE +; RUN: llvm-link -S -only-needed %s %p/Inputs/only-needed-dtors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=ONLY-NEEDED --check-prefix=NO-INTERNALIZE +; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-dtors.ll | FileCheck %s --check-prefix=CHECK --check-prefix=ONLY-NEEDED --check-prefix=INTERNALIZE + +; Destination module: + +define void @foo() { + ret void +} + +define internal void @dtor1() { + ret void +} + +@llvm.global_dtors = appending global[1 x{i32, void() *, i8 * }] [ + {i32, void() *, i8 * } { i32 4, void() *@dtor1, i8 *null}] + + +; CHECK: @llvm.global_dtors = appending global [3 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 4, void ()* @dtor1, i8* null }, { i32, void ()*, i8* } { i32 2, void ()* @dtor1.2, i8* null }, { i32, void ()*, i8* } { i32 7, void ()* @dtor2, i8* null }] +; CHECK: define internal void @dtor1() +; CHECK: define void @foo() +; CHECK: define internal void @dtor1.{{[0-9]+}}() +; CHECK: define internal void @dtor2() +; NO-INTERNALIZE: define void @func1() +; INTERNALIZE: define internal void @func1() +; LINK-ALL: define {{(internal )?}}void @unused() +; ONLY-NEEDED-NOT: void @unused() diff --git a/test/Linker/only-needed-used.ll b/test/Linker/only-needed-used.ll new file mode 100644 index 000000000000..7eff3b5db664 --- /dev/null +++ b/test/Linker/only-needed-used.ll @@ -0,0 +1,11 @@ +; RUN: llvm-link -S %s %p/Inputs/only-needed-used.ll | FileCheck %s +; RUN: llvm-link -S -internalize %s %p/Inputs/only-needed-used.ll | FileCheck %s +; RUN: llvm-link -S -only-needed %s %p/Inputs/only-needed-used.ll | FileCheck %s +; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-used.ll | FileCheck %s + +; Empty destination module! + + +; CHECK-DAG: @llvm.used = appending global [2 x i8*] [i8* @used1, i8* bitcast (i32* @used2 to i8*)], section "llvm.metadata" +; CHECK-DAG: @used1 = global i8 4 +; CHECK-DAG: @used2 = global i32 123 diff --git a/test/MC/Disassembler/Mips/mt/valid-r2-el.txt b/test/MC/Disassembler/Mips/mt/valid-r2-el.txt index 7025354d6847..62e7092086aa 100644 --- a/test/MC/Disassembler/Mips/mt/valid-r2-el.txt +++ b/test/MC/Disassembler/Mips/mt/valid-r2-el.txt @@ -10,4 +10,23 @@ 0x08 0x10 0x65 0x7c # CHECK: fork $2, $3, $5 0x09 0x00 0x80 0x7c # CHECK: yield $4 0x09 0x20 0xa0 0x7c # CHECK: yield $4, $5 - +0x02 0x20 0x05 0x41 # CHECK: mftr $4, $5, 0, 2, 0 +0x20 0x20 0x05 0x41 # CHECK: mftr $4, $5, 1, 0, 0 +0x21 0x20 0x00 0x41 # CHECK: mftr $4, $zero, 1, 1, 0 +0x21 0x20 0x0a 0x41 # CHECK: mftr $4, $10, 1, 1, 0 +0x22 0x20 0x0a 0x41 # CHECK: mftr $4, $10, 1, 2, 0 +0x32 0x20 0x0a 0x41 # CHECK: mftr $4, $10, 1, 2, 1 +0x23 0x20 0x1a 0x41 # CHECK: mftr $4, $26, 1, 3, 0 +0x23 0x20 0x1f 0x41 # CHECK: mftr $4, $ra, 1, 3, 0 +0x24 0x20 0x0e 0x41 # CHECK: mftr $4, $14, 1, 4, 0 +0x25 0x20 0x0f 0x41 # CHECK: mftr $4, $15, 1, 5, 0 +0x02 0x28 0x84 0x41 # CHECK: mttr $4, $5, 0, 2, 0 +0x20 0x28 0x84 0x41 # CHECK: mttr $4, $5, 1, 0, 0 +0x21 0x00 0x84 0x41 # CHECK: mttr $4, $zero, 1, 1, 0 +0x21 0x50 0x84 0x41 # CHECK: mttr $4, $10, 1, 1, 0 +0x22 0x50 0x84 0x41 # CHECK: mttr $4, $10, 1, 2, 0 +0x32 0x50 0x84 0x41 # CHECK: mttr $4, $10, 1, 2, 1 +0x23 0xd0 0x84 0x41 # CHECK: mttr $4, $26, 1, 3, 0 +0x23 0xf8 0x84 0x41 # CHECK: mttr $4, $ra, 1, 3, 0 +0x24 0x70 0x84 0x41 # CHECK: mttr $4, $14, 1, 4, 0 +0x25 0x78 0x84 0x41 # CHECK: mttr $4, $15, 1, 5, 0 diff --git a/test/MC/Disassembler/Mips/mt/valid-r2.txt b/test/MC/Disassembler/Mips/mt/valid-r2.txt index 17c42c0614a5..4786d8b5591f 100644 --- a/test/MC/Disassembler/Mips/mt/valid-r2.txt +++ b/test/MC/Disassembler/Mips/mt/valid-r2.txt @@ -10,4 +10,23 @@ 0x7c 0x65 0x10 0x08 # CHECK: fork $2, $3, $5 0x7c 0x80 0x00 0x09 # CHECK: yield $4 0x7c 0xa0 0x20 0x09 # CHECK: yield $4, $5 - +0x41 0x05 0x20 0x02 # CHECK: mftr $4, $5, 0, 2, 0 +0x41 0x05 0x20 0x20 # CHECK: mftr $4, $5, 1, 0, 0 +0x41 0x00 0x20 0x21 # CHECK: mftr $4, $zero, 1, 1, 0 +0x41 0x0a 0x20 0x21 # CHECK: mftr $4, $10, 1, 1, 0 +0x41 0x0a 0x20 0x22 # CHECK: mftr $4, $10, 1, 2, 0 +0x41 0x0a 0x20 0x32 # CHECK: mftr $4, $10, 1, 2, 1 +0x41 0x1a 0x20 0x23 # CHECK: mftr $4, $26, 1, 3, 0 +0x41 0x1f 0x20 0x23 # CHECK: mftr $4, $ra, 1, 3, 0 +0x41 0x0e 0x20 0x24 # CHECK: mftr $4, $14, 1, 4, 0 +0x41 0x0f 0x20 0x25 # CHECK: mftr $4, $15, 1, 5, 0 +0x41 0x84 0x28 0x02 # CHECK: mttr $4, $5, 0, 2, 0 +0x41 0x84 0x28 0x20 # CHECK: mttr $4, $5, 1, 0, 0 +0x41 0x84 0x00 0x21 # CHECK: mttr $4, $zero, 1, 1, 0 +0x41 0x84 0x50 0x21 # CHECK: mttr $4, $10, 1, 1, 0 +0x41 0x84 0x50 0x22 # CHECK: mttr $4, $10, 1, 2, 0 +0x41 0x84 0x50 0x32 # CHECK: mttr $4, $10, 1, 2, 1 +0x41 0x84 0xd0 0x23 # CHECK: mttr $4, $26, 1, 3, 0 +0x41 0x84 0xf8 0x23 # CHECK: mttr $4, $ra, 1, 3, 0 +0x41 0x84 0x70 0x24 # CHECK: mttr $4, $14, 1, 4, 0 +0x41 0x84 0x78 0x25 # CHECK: mttr $4, $15, 1, 5, 0 diff --git a/test/MC/Mips/macro-aliases-invalid-wrong-error.s b/test/MC/Mips/macro-aliases-invalid-wrong-error.s new file mode 100644 index 000000000000..b87646d0b09a --- /dev/null +++ b/test/MC/Mips/macro-aliases-invalid-wrong-error.s @@ -0,0 +1,38 @@ +# RUN: not llvm-mc -arch=mips %s 2>%t1 +# RUN: FileCheck --check-prefix=O32 %s < %t1 + +# RUN: not llvm-mc -arch=mips64 %s 2>%t1 +# RUN: FileCheck --check-prefix=N64 %s < %t1 + +# Check that subu only rejects any non-constant values. + +.globl end + subu $4, $4, %lo($start) # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, $4, $start # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, $a4, $a4 # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, $4, %hi(end) # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, $4, end + 4 # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, $4, end # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, $4, sp # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + + subu $4, %lo($start) # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, $start # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, $a4 # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, %hi(end) # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, end + 4 # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, end # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + subu $4, sp # O32: [[@LINE]]:{{[0-9]+}}: error: unexpected token in argument list + # N64: [[@LINE-1]]:{{[0-9]+}}: error: unexpected token in argument list + +$start: diff --git a/test/MC/Mips/macro-aliases.s b/test/MC/Mips/macro-aliases.s new file mode 100644 index 000000000000..daa1d8b2437c --- /dev/null +++ b/test/MC/Mips/macro-aliases.s @@ -0,0 +1,35 @@ +# RUN: llvm-mc -arch=mips -mcpu=mips32r2 %s -show-inst | FileCheck %s + +# Test that subu accepts constant operands and inverts them when +# rendering the operand. + + subu $4, $4, 4 # CHECK: ADDiu + # CHECK; Imm:-4 + subu $gp, $gp, 4 # CHECK: ADDiu + # CHECK; Imm:-4 + subu $sp, $sp, 4 # CHECK: ADDiu + # CHECK; Imm:-4 + subu $4, $4, -4 # CHECK: ADDiu + # CHECK; Imm:4 + subu $gp, $gp, -4 # CHECK: ADDiu + # CHECK; Imm:4 + subu $sp, $sp, -4 # CHECK: ADDiu + # CHECK; Imm:4 + subu $sp, $sp, -(4 + 4) # CHECK: ADDiu + # CHECK: Imm:8 + + subu $4, 8 # CHECK: ADDiu + # CHECK; Imm:-8 + subu $gp, 8 # CHECK: ADDiu + # CHECK; Imm:-8 + subu $sp, 8 # CHECK: ADDiu + # CHECK; Imm:-8 + subu $4, -8 # CHECK: ADDiu + # CHECK; Imm:8 + subu $gp, -8 # CHECK: ADDiu + # CHECK; Imm:8 + subu $sp, -8 # CHECK: ADDiu + # CHECK; Imm:8 + subu $sp, -(4 + 4) # CHECK: ADDiu + # CHECK: Imm:8 + diff --git a/test/MC/Mips/mt/invalid-wrong-error.s b/test/MC/Mips/mt/invalid-wrong-error.s new file mode 100644 index 000000000000..6de852cf0cbe --- /dev/null +++ b/test/MC/Mips/mt/invalid-wrong-error.s @@ -0,0 +1,4 @@ +# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt < %s 2>%t1 +# RUN: FileCheck %s < %t1 + mftr 0($4), $5, 0, 0, 0 # CHECK: error: unexpected token in argument list + mttr 0($4), $5, 0, 0, 0 # CHECK: error: unexpected token in argument list diff --git a/test/MC/Mips/mt/invalid.s b/test/MC/Mips/mt/invalid.s index 5a145a7e0850..02e96f0a1a3b 100644 --- a/test/MC/Mips/mt/invalid.s +++ b/test/MC/Mips/mt/invalid.s @@ -11,3 +11,4 @@ evpe 4 # CHECK: error: invalid operand for instruction evpe $4, $5 # CHECK: error: invalid operand for instruction evpe $5, 0($5) # CHECK: error: invalid operand for instruction + # FIXME: add tests for mftr/mttr. diff --git a/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s b/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s new file mode 100644 index 000000000000..d931b499f26e --- /dev/null +++ b/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s @@ -0,0 +1,18 @@ +# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s 2>%t1 +# RUN: FileCheck %s < %t1 + +# The integrated assembler produces a wrong or misleading error message. + + mftc0 0($4), $5 # CHECK: error: unexpected token in argument list + mftc0 0($4), $5, 1 # CHECK: error: unexpected token in argument list + mftgpr 0($4), $5 # CHECK: error: unexpected token in argument list + mftlo 0($3) # CHECK: error: unexpected token in argument list + mftlo 0($3), $ac1 # CHECK: error: unexpected token in argument list + mfthi 0($3) # CHECK: error: unexpected token in argument list + mfthi 0($3), $ac1 # CHECK: error: unexpected token in argument list + mftacx 0($3) # CHECK: error: unexpected token in argument list + mftacx 0($3), $ac1 # CHECK: error: unexpected token in argument list + mftdsp 0($4) # CHECK: error: unexpected token in argument list + mftc1 0($4), $f4 # CHECK: error: unexpected token in argument list + mfthc1 0($4), $f4 # CHECK: error: unexpected token in argument list + cftc1 0($4), $f8 # CHECK: error: unexpected token in argument list diff --git a/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s b/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s new file mode 100644 index 000000000000..17d954030cd1 --- /dev/null +++ b/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s @@ -0,0 +1,23 @@ +# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s 2>%t1 +# RUN: FileCheck %s < %t1 + + mftc0 $4, 0($5) # CHECK: error: invalid operand for instruction + mftc0 $4, 0($5), 1 # CHECK: error: invalid operand for instruction + mftc0 $4, $5, -1 # CHECK: error: expected 3-bit unsigned immediate + mftc0 $4, $5, 9 # CHECK: error: expected 3-bit unsigned immediate + mftc0 $4, $5, $6 # CHECK: error: expected 3-bit unsigned immediate + mftgpr $4, 0($5) # CHECK: error: invalid operand for instruction + mftgpr $4, $5, $6 # CHECK: error: invalid operand for instruction + mftlo $3, 0($ac1) # CHECK: error: invalid operand for instruction + mftlo $4, $ac1, $4 # CHECK: error: invalid operand for instruction + mfthi $3, 0($ac1) # CHECK: error: invalid operand for instruction + mfthi $4, $ac1, $4 # CHECK: error: invalid operand for instruction + mftacx $3, 0($ac1) # CHECK: error: invalid operand for instruction + mftacx $4, $ac1, $4 # CHECK: error: invalid operand for instruction + mftdsp $4, $5 # CHECK: error: invalid operand for instruction + mftdsp $4, $f5 # CHECK: error: invalid operand for instruction + mftdsp $4, $ac0 # CHECK: error: invalid operand for instruction + mftc1 $4, 0($f4) # CHECK: error: invalid operand for instruction + mfthc1 $4, 0($f4) # CHECK: error: invalid operand for instruction + cftc1 $4, 0($f4) # CHECK: error: invalid operand for instruction + cftc1 $4, $f4, $5 # CHECK: error: invalid operand for instruction diff --git a/test/MC/Mips/mt/mftr-mttr-aliases.s b/test/MC/Mips/mt/mftr-mttr-aliases.s new file mode 100644 index 000000000000..92ed9f9281f2 --- /dev/null +++ b/test/MC/Mips/mt/mftr-mttr-aliases.s @@ -0,0 +1,47 @@ +# RUN: llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s | FileCheck %s + +# Check the various aliases of the m[ft]tr instruction. + + mftc0 $4, $5 # CHECK: mftr $4, $5, 0, 0, 0 # encoding: [0x41,0x05,0x20,0x00] + mftc0 $6, $7, 1 # CHECK: mftr $6, $7, 0, 1, 0 # encoding: [0x41,0x07,0x30,0x01] + mftgpr $5, $9 # CHECK: mftr $5, $9, 1, 0, 0 # encoding: [0x41,0x09,0x28,0x20] + mftlo $3 # CHECK: mftr $3, $zero, 1, 1, 0 # encoding: [0x41,0x00,0x18,0x21] + mftlo $3, $ac0 # CHECK: mftr $3, $zero, 1, 1, 0 # encoding: [0x41,0x00,0x18,0x21] + mftlo $3, $ac1 # CHECK: mftr $3, $4, 1, 1, 0 # encoding: [0x41,0x04,0x18,0x21] + mftlo $3, $ac2 # CHECK: mftr $3, $8, 1, 1, 0 # encoding: [0x41,0x08,0x18,0x21] + mftlo $3, $ac3 # CHECK: mftr $3, $12, 1, 1, 0 # encoding: [0x41,0x0c,0x18,0x21] + mfthi $3, $ac0 # CHECK: mftr $3, $1, 1, 1, 0 # encoding: [0x41,0x01,0x18,0x21] + mfthi $3, $ac1 # CHECK: mftr $3, $5, 1, 1, 0 # encoding: [0x41,0x05,0x18,0x21] + mfthi $3, $ac2 # CHECK: mftr $3, $9, 1, 1, 0 # encoding: [0x41,0x09,0x18,0x21] + mfthi $3, $ac3 # CHECK: mftr $3, $13, 1, 1, 0 # encoding: [0x41,0x0d,0x18,0x21] + mftacx $3, $ac0 # CHECK: mftr $3, $2, 1, 1, 0 # encoding: [0x41,0x02,0x18,0x21] + mftacx $3, $ac1 # CHECK: mftr $3, $6, 1, 1, 0 # encoding: [0x41,0x06,0x18,0x21] + mftacx $3, $ac2 # CHECK: mftr $3, $10, 1, 1, 0 # encoding: [0x41,0x0a,0x18,0x21] + mftacx $3, $ac3 # CHECK: mftr $3, $14, 1, 1, 0 # encoding: [0x41,0x0e,0x18,0x21] + mftdsp $4 # CHECK: mftr $4, $16, 1, 1, 0 # encoding: [0x41,0x10,0x20,0x21] + mftc1 $4, $f5 # CHECK: mftr $4, $5, 1, 2, 0 # encoding: [0x41,0x05,0x20,0x22] + mfthc1 $4, $f5 # CHECK: mftr $4, $5, 1, 2, 1 # encoding: [0x41,0x05,0x20,0x32] + cftc1 $4, $f9 # CHECK: mftr $4, $9, 1, 3, 0 # encoding: [0x41,0x09,0x20,0x23] + + mttc0 $4, $5 # CHECK: mttr $4, $5, 0, 0, 0 # encoding: [0x41,0x84,0x28,0x00] + mttc0 $6, $7, 1 # CHECK: mttr $6, $7, 0, 1, 0 # encoding: [0x41,0x86,0x38,0x01] + mttgpr $5, $9 # CHECK: mttr $5, $9, 1, 0, 0 # encoding: [0x41,0x85,0x48,0x20] + mttlo $3 # CHECK: mttr $3, $zero, 1, 1, 0 # encoding: [0x41,0x83,0x00,0x21] + mttlo $3, $ac0 # CHECK: mttr $3, $zero, 1, 1, 0 # encoding: [0x41,0x83,0x00,0x21] + mttlo $3, $ac1 # CHECK: mttr $3, $4, 1, 1, 0 # encoding: [0x41,0x83,0x20,0x21] + mttlo $3, $ac2 # CHECK: mttr $3, $8, 1, 1, 0 # encoding: [0x41,0x83,0x40,0x21] + mttlo $3, $ac3 # CHECK: mttr $3, $12, 1, 1, 0 # encoding: [0x41,0x83,0x60,0x21] + mtthi $3 # CHECK: mttr $3, $1, 1, 1, 0 # encoding: [0x41,0x83,0x08,0x21] + mtthi $3, $ac0 # CHECK: mttr $3, $1, 1, 1, 0 # encoding: [0x41,0x83,0x08,0x21] + mtthi $3, $ac1 # CHECK: mttr $3, $5, 1, 1, 0 # encoding: [0x41,0x83,0x28,0x21] + mtthi $3, $ac2 # CHECK: mttr $3, $9, 1, 1, 0 # encoding: [0x41,0x83,0x48,0x21] + mtthi $3, $ac3 # CHECK: mttr $3, $13, 1, 1, 0 # encoding: [0x41,0x83,0x68,0x21] + mttacx $3 # CHECK: mttr $3, $2, 1, 1, 0 # encoding: [0x41,0x83,0x10,0x21] + mttacx $3, $ac0 # CHECK: mttr $3, $2, 1, 1, 0 # encoding: [0x41,0x83,0x10,0x21] + mttacx $3, $ac1 # CHECK: mttr $3, $6, 1, 1, 0 # encoding: [0x41,0x83,0x30,0x21] + mttacx $3, $ac2 # CHECK: mttr $3, $10, 1, 1, 0 # encoding: [0x41,0x83,0x50,0x21] + mttacx $3, $ac3 # CHECK: mttr $3, $14, 1, 1, 0 # encoding: [0x41,0x83,0x70,0x21] + mttdsp $4 # CHECK: mttr $4, $16, 1, 1, 0 # encoding: [0x41,0x84,0x80,0x21] + mttc1 $4, $f5 # CHECK: mttr $4, $5, 1, 2, 0 # encoding: [0x41,0x84,0x28,0x22] + mtthc1 $4, $f5 # CHECK: mttr $4, $5, 1, 2, 1 # encoding: [0x41,0x84,0x28,0x32] + cttc1 $4, $f9 # CHECK: mttr $4, $9, 1, 3, 0 # encoding: [0x41,0x84,0x48,0x23] diff --git a/test/MC/Mips/mt/mftr-mttr-reserved-valid.s b/test/MC/Mips/mt/mftr-mttr-reserved-valid.s new file mode 100644 index 000000000000..c40e81bfc7d7 --- /dev/null +++ b/test/MC/Mips/mt/mftr-mttr-reserved-valid.s @@ -0,0 +1,8 @@ +# RUN: llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s | FileCheck %s + +# The selector value and register values here are marked as reserved in the +# documentation, but GAS accepts them without warning. + mftr $31, $31, 1, 1, 0 # CHECK: mftr $ra, $ra, 1, 1, 0 # encoding: [0x41,0x1f,0xf8,0x21] + mttr $31, $31, 1, 1, 0 # CHECK: mttr $ra, $ra, 1, 1, 0 # encoding: [0x41,0x9f,0xf8,0x21] + mftr $31, $13, 1, 6, 0 # CHECK: mftr $ra, $13, 1, 6, 0 # encoding: [0x41,0x0d,0xf8,0x26] + mttr $31, $13, 1, 6, 0 # CHECK: mttr $ra, $13, 1, 6, 0 # encoding: [0x41,0x9f,0x68,0x26] diff --git a/test/MC/Mips/mt/valid.s b/test/MC/Mips/mt/valid.s index ab1179d05c6a..9fa07870a61f 100644 --- a/test/MC/Mips/mt/valid.s +++ b/test/MC/Mips/mt/valid.s @@ -1,13 +1,33 @@ # RUN: llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s \ # RUN: | FileCheck %s - dmt # CHECK: dmt # encoding: [0x41,0x60,0x0b,0xc1] - dmt $5 # CHECK: dmt $5 # encoding: [0x41,0x65,0x0b,0xc1] - emt # CHECK: emt # encoding: [0x41,0x60,0x0b,0xe1] - emt $4 # CHECK: emt $4 # encoding: [0x41,0x64,0x0b,0xe1] - dvpe # CHECK: dvpe # encoding: [0x41,0x60,0x00,0x01] - dvpe $6 # CHECK: dvpe $6 # encoding: [0x41,0x66,0x00,0x01] - evpe # CHECK: evpe # encoding: [0x41,0x60,0x00,0x21] - evpe $4 # CHECK: evpe $4 # encoding: [0x41,0x64,0x00,0x21] - fork $2, $3, $5 # CHECK: fork $2, $3, $5 # encoding: [0x7c,0x65,0x10,0x08] - yield $4 # CHECK: yield $4 # encoding: [0x7c,0x80,0x00,0x09] - yield $4, $5 # CHECK: yield $4, $5 # encoding: [0x7c,0xa0,0x20,0x09] + dmt # CHECK: dmt # encoding: [0x41,0x60,0x0b,0xc1] + dmt $5 # CHECK: dmt $5 # encoding: [0x41,0x65,0x0b,0xc1] + emt # CHECK: emt # encoding: [0x41,0x60,0x0b,0xe1] + emt $4 # CHECK: emt $4 # encoding: [0x41,0x64,0x0b,0xe1] + dvpe # CHECK: dvpe # encoding: [0x41,0x60,0x00,0x01] + dvpe $6 # CHECK: dvpe $6 # encoding: [0x41,0x66,0x00,0x01] + evpe # CHECK: evpe # encoding: [0x41,0x60,0x00,0x21] + evpe $4 # CHECK: evpe $4 # encoding: [0x41,0x64,0x00,0x21] + fork $2, $3, $5 # CHECK: fork $2, $3, $5 # encoding: [0x7c,0x65,0x10,0x08] + yield $4 # CHECK: yield $4 # encoding: [0x7c,0x80,0x00,0x09] + yield $4, $5 # CHECK: yield $4, $5 # encoding: [0x7c,0xa0,0x20,0x09] + mftr $4, $5, 0, 2, 0 # CHECK: mftr $4, $5, 0, 2, 0 # encoding: [0x41,0x05,0x20,0x02] + mftr $4, $5, 1, 0, 0 # CHECK: mftr $4, $5, 1, 0, 0 # encoding: [0x41,0x05,0x20,0x20] + mftr $4, $0, 1, 1, 0 # CHECK: mftr $4, $zero, 1, 1, 0 # encoding: [0x41,0x00,0x20,0x21] + mftr $4, $10, 1, 1, 0 # CHECK: mftr $4, $10, 1, 1, 0 # encoding: [0x41,0x0a,0x20,0x21] + mftr $4, $10, 1, 2, 0 # CHECK: mftr $4, $10, 1, 2, 0 # encoding: [0x41,0x0a,0x20,0x22] + mftr $4, $10, 1, 2, 1 # CHECK: mftr $4, $10, 1, 2, 1 # encoding: [0x41,0x0a,0x20,0x32] + mftr $4, $26, 1, 3, 0 # CHECK: mftr $4, $26, 1, 3, 0 # encoding: [0x41,0x1a,0x20,0x23] + mftr $4, $31, 1, 3, 0 # CHECK: mftr $4, $ra, 1, 3, 0 # encoding: [0x41,0x1f,0x20,0x23] + mftr $4, $14, 1, 4, 0 # CHECK: mftr $4, $14, 1, 4, 0 # encoding: [0x41,0x0e,0x20,0x24] + mftr $4, $15, 1, 5, 0 # CHECK: mftr $4, $15, 1, 5, 0 # encoding: [0x41,0x0f,0x20,0x25] + mttr $4, $5, 0, 2, 0 # CHECK: mttr $4, $5, 0, 2, 0 # encoding: [0x41,0x84,0x28,0x02] + mttr $4, $5, 1, 0, 0 # CHECK: mttr $4, $5, 1, 0, 0 # encoding: [0x41,0x84,0x28,0x20] + mttr $4, $0, 1, 1, 0 # CHECK: mttr $4, $zero, 1, 1, 0 # encoding: [0x41,0x84,0x00,0x21] + mttr $4, $10, 1, 1, 0 # CHECK: mttr $4, $10, 1, 1, 0 # encoding: [0x41,0x84,0x50,0x21] + mttr $4, $10, 1, 2, 0 # CHECK: mttr $4, $10, 1, 2, 0 # encoding: [0x41,0x84,0x50,0x22] + mttr $4, $10, 1, 2, 1 # CHECK: mttr $4, $10, 1, 2, 1 # encoding: [0x41,0x84,0x50,0x32] + mttr $4, $26, 1, 3, 0 # CHECK: mttr $4, $26, 1, 3, 0 # encoding: [0x41,0x84,0xd0,0x23] + mttr $4, $31, 1, 3, 0 # CHECK: mttr $4, $ra, 1, 3, 0 # encoding: [0x41,0x84,0xf8,0x23] + mttr $4, $14, 1, 4, 0 # CHECK: mttr $4, $14, 1, 4, 0 # encoding: [0x41,0x84,0x70,0x24] + mttr $4, $15, 1, 5, 0 # CHECK: mttr $4, $15, 1, 5, 0 # encoding: [0x41,0x84,0x78,0x25] diff --git a/test/MC/Mips/tls-symbols.s b/test/MC/Mips/tls-symbols.s new file mode 100644 index 000000000000..d5a31b189502 --- /dev/null +++ b/test/MC/Mips/tls-symbols.s @@ -0,0 +1,28 @@ +# RUN: llvm-mc -arch=mips < %s -position-independent -filetype=obj \ +# RUN: | llvm-readelf -symbols | FileCheck %s +# RUN: llvm-mc -arch=mips < %s -filetype=obj | llvm-readelf -symbols \ +# RUN: | FileCheck %s + +# Test that TLS relocations cause symbols to be marked as TLS symbols. + + .set noat + lui $3, %tlsgd(foo1) + lui $1, %dtprel_hi(foo2) + lui $1, %dtprel_lo(foo3) + lui $1, %tprel_hi(foo4) + lui $1, %tprel_lo(foo5) + lw $2, %gottprel(foo6)($28) + + .hidden foo1 + .hidden foo2 + .hidden foo3 + .hidden foo4 + .hidden foo5 + .hidden foo6 + +# CHECK: 1: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo1 +# CHECK: 2: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo2 +# CHECK: 3: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo3 +# CHECK: 4: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo4 +# CHECK: 5: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo5 +# CHECK: 6: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo6 diff --git a/test/Transforms/InstCombine/gep-vector.ll b/test/Transforms/InstCombine/gep-vector.ll index ce021bf207fc..f7ed1a776f53 100644 --- a/test/Transforms/InstCombine/gep-vector.ll +++ b/test/Transforms/InstCombine/gep-vector.ll @@ -13,3 +13,12 @@ define <8 x i64*> @patatino2() { %el = getelementptr inbounds i64, i64* undef, <8 x i64> undef ret <8 x i64*> %el } + +@block = global [64 x [8192 x i8]] zeroinitializer, align 1 + +; CHECK-LABEL:vectorindex +; CHECK-NEXT: ret <2 x i8*> getelementptr inbounds ([64 x [8192 x i8]], [64 x [8192 x i8]]* @block, <2 x i64> zeroinitializer, <2 x i64> , <2 x i64> ) +define <2 x i8*> @vectorindex() { + %1 = getelementptr inbounds [64 x [8192 x i8]], [64 x [8192 x i8]]* @block, i64 0, <2 x i64> , i64 8192 + ret <2 x i8*> %1 +} diff --git a/test/Transforms/SimplifyCFG/gepcost.ll b/test/Transforms/SimplifyCFG/gepcost.ll new file mode 100644 index 000000000000..10751f747e33 --- /dev/null +++ b/test/Transforms/SimplifyCFG/gepcost.ll @@ -0,0 +1,28 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt < %s -S -simplifycfg | FileCheck %s + +target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "thumbv7m-none--eabi" + +@glob = external unnamed_addr constant [16 x i8] + +define void @f() { +; CHECK-LABEL: @f( +; CHECK-NEXT: entr: +; CHECK-NEXT: br i1 undef, label [[NEXT:%.*]], label [[EXIT:%.*]] +; CHECK: next: +; CHECK-NEXT: [[PAT:%.*]] = getelementptr [16 x i8], [16 x i8]* @glob +; CHECK-NEXT: br label [[EXIT]] +; CHECK: exit: +; CHECK-NEXT: ret void +; +entr: + br i1 undef, label %next, label %exit + +next: + %pat = getelementptr [16 x i8], [16 x i8]* @glob + br label %exit + +exit: + ret void +} diff --git a/unittests/Support/FormatVariadicTest.cpp b/unittests/Support/FormatVariadicTest.cpp index 5387a8ae499c..bfbe556b31a7 100644 --- a/unittests/Support/FormatVariadicTest.cpp +++ b/unittests/Support/FormatVariadicTest.cpp @@ -553,6 +553,12 @@ TEST(FormatVariadicTest, Adapter) { formatv("{0,=34:X-}", fmt_repeat(fmt_pad(N, 1, 3), 5)).str()); } +TEST(FormatVariadicTest, MoveConstructor) { + auto fmt = formatv("{0} {1}", 1, 2); + auto fmt2 = std::move(fmt); + std::string S = fmt2; + EXPECT_EQ("1 2", S); +} TEST(FormatVariadicTest, ImplicitConversions) { std::string S = formatv("{0} {1}", 1, 2); EXPECT_EQ("1 2", S); diff --git a/unittests/Support/Host.cpp b/unittests/Support/Host.cpp index 4f895e7163c5..7c018ac50423 100644 --- a/unittests/Support/Host.cpp +++ b/unittests/Support/Host.cpp @@ -105,6 +105,9 @@ TEST(getLinuxHostCPUName, AArch64) { EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x51\n" "CPU part : 0x201"), "kryo"); + EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0x51\n" + "CPU part : 0xc00"), + "falkor"); // MSM8992/4 weirdness StringRef MSM8992ProcCpuInfo = R"( diff --git a/utils/release/merge-request.sh b/utils/release/merge-request.sh index 703023aaa797..6691b3733bbf 100755 --- a/utils/release/merge-request.sh +++ b/utils/release/merge-request.sh @@ -14,7 +14,7 @@ dryrun="" stable_version="" -revision="" +revisions="" BUGZILLA_BIN="" BUGZILLA_CMD="" release_metabug="" @@ -31,6 +31,7 @@ function usage() { echo " -user EMAIL Your email address for logging into bugzilla." echo " -stable-version X.Y The stable release version (e.g. 4.0, 5.0)." echo " -r NUM Revision number to merge (e.g. 1234567)." + echo " This option can be specified multiple times." echo " -bugzilla-bin PATH Path to bugzilla binary (optional)." echo " -assign-to EMAIL Assign bug to user with EMAIL (optional)." echo " -dry-run Print commands instead of executing them." @@ -48,7 +49,7 @@ while [ $# -gt 0 ]; do ;; -r) shift - revision="$1" + revisions="$revisions $1" ;; -project) shift @@ -91,14 +92,17 @@ case $stable_version in 4.0) release_metabug="32061" ;; + 5.0) + release_metabug="34492" + ;; *) echo "error: invalid stable version" exit 1 esac bugzilla_version=$stable_version -if [ -z "$revision" ]; then - echo "error: revision not specified" +if [ -z "$revisions" ]; then + echo "error: no revisions specified" exit 1 fi @@ -124,25 +128,23 @@ BUGZILLA_MAJOR_VERSION=`$BUGZILLA_BIN --version 2>&1 | cut -d . -f 1` if [ $BUGZILLA_MAJOR_VERSION -eq 1 ]; then - echo "***************************** Warning *******************************" - echo "You are using an older version of the bugzilla cli tool. You will be " - echo "able to create bugs, but this script will crash with the following " - echo "error when trying to read back information about the bug you created:" - echo "" - echo "KeyError: 'internals'" - echo "" - echo "To avoid this error, use version 2.0.0 or higher" - echo "https://pypi.python.org/pypi/python-bugzilla" - echo "*********************************************************************" + echo "***************************** Error ** ********************************" + echo "You are using an older version of the bugzilla cli tool, which is not " + echo "supported. You need to use bugzilla cli version 2.0.0 or higher:" + echo "***********************************************************************" + exit 1 fi BUGZILLA_CMD="$BUGZILLA_BIN --bugzilla=$bugzilla_url" -bug_url="https://reviews.llvm.org/rL$revision" +rev_string="" +for r in $revisions; do + rev_string="$rev_string r$r" +done echo "Checking for duplicate bugs..." -check_duplicates=`$BUGZILLA_CMD query --url $bug_url` +check_duplicates=`$BUGZILLA_CMD query --blocked=$release_metabug --field="cf_fixed_by_commits=$rev_string"` if [ -n "$check_duplicates" ]; then echo "Duplicate bug found:" @@ -152,47 +154,55 @@ fi echo "Done" -# Get short commit summary +# Get short commit summary. To avoid having a huge summary, we just +# use the commit message for the first commit. commit_summary='' -commit_msg=`svn log -r $revision https://llvm.org/svn/llvm-project/` -if [ $? -ne 0 ]; then - echo "warning: failed to get commit message." - commit_msg="" -fi +for r in $revisions; do + commit_msg=`svn log -r $r https://llvm.org/svn/llvm-project/` + if [ $? -ne 0 ]; then + echo "warning: failed to get commit message." + commit_msg="" + fi + break +done if [ -n "$commit_msg" ]; then commit_summary=`echo "$commit_msg" | sed '4q;d' | cut -c1-80` commit_summary=" : ${commit_summary}" fi -bug_summary="Merge r$revision into the $stable_version branch${commit_summary}" +bug_summary="Merge${rev_string} into the $stable_version branch${commit_summary}" -if [ -z "$dryrun" ]; then - set -x -fi +set -x -${dryrun} $BUGZILLA_CMD --login --user=$bugzilla_user new \ +# Login to bugzilla +$BUGZILLA_CMD login $bugzilla_user + +bug_id=`${dryrun} $BUGZILLA_CMD --ensure-logged-in new \ -p "$bugzilla_product" \ - -c "$bugzilla_component" -u $bug_url --blocked=$release_metabug \ + -c "$bugzilla_component" --blocked=$release_metabug \ -o All --priority=P --arch All -v $bugzilla_version \ + --field="cf_fixed_by_commits=$rev_string" \ --summary "${bug_summary}" \ - -l "Is this patch OK to merge to the $stable_version branch?" \ + -l "Is it OK to merge the following revision(s) to the $stable_version branch?" \ $bugzilla_assigned_to \ - --oneline - -set +x + -i` if [ -n "$dryrun" ]; then exit 0 fi -if [ $BUGZILLA_MAJOR_VERSION -eq 1 ]; then - success=`$BUGZILLA_CMD query --url $bug_url` - if [ -z "$success" ]; then - echo "Failed to create bug." - exit 1 - fi +set +x - echo " Created new bug:" - echo $success +if [ -z "$bug_id" ]; then + echo "Failed to create bug." + exit 1 fi + +echo " Created new bug:" +echo https://llvm.org/PR$bug_id + +# Add links to revisions +for r in $revisions; do + $BUGZILLA_CMD --ensure-logged-in modify -l "https://reviews.llvm.org/rL$r" $bug_id +done From b5ea630dfd1a0d3e5c08d8959158608dd213d9aa Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 2 Dec 2017 12:46:48 +0000 Subject: [PATCH 2/5] Vendor import of clang release_50 branch r319231: https://llvm.org/svn/llvm-project/cfe/branches/release_50@319231 --- bindings/python/clang/cindex.py | 8 ++-- .../python/tests/cindex/test_diagnostics.py | 8 ++++ .../test_exception_specification_kind.py | 0 include/clang/Basic/Attr.td | 4 +- include/clang/Basic/AttrDocs.td | 15 ++++++ include/clang/Basic/BuiltinsX86.def | 1 - include/clang/Basic/DiagnosticSemaKinds.td | 2 +- lib/AST/ExprConstant.cpp | 24 +++++----- lib/Basic/Targets.cpp | 11 +++-- lib/Basic/Version.cpp | 2 +- lib/CodeGen/CGExpr.cpp | 11 ++--- lib/CodeGen/CGOpenMPRuntime.cpp | 35 +++++++++++--- lib/CodeGen/CGOpenMPRuntime.h | 4 ++ lib/CodeGen/CGStmtOpenMP.cpp | 13 ++++-- lib/CodeGen/CodeGenFunction.h | 6 ++- lib/Driver/ToolChain.cpp | 5 -- lib/Driver/ToolChains/BareMetal.cpp | 8 ---- lib/Driver/ToolChains/BareMetal.h | 2 - lib/Driver/ToolChains/Clang.cpp | 6 ++- lib/Format/Format.cpp | 2 +- lib/Headers/avx512fintrin.h | 9 +--- lib/Sema/SemaOpenMP.cpp | 23 ++++++---- test/CodeGen/avx512f-builtins.c | 7 +++ test/CodeGen/tbaa-vec.cpp | 20 ++++++++ test/Driver/baremetal.cpp | 10 +++- test/OpenMP/cancel_codegen_cleanup.cpp | 46 +++++++++++++++++++ test/OpenMP/declare_reduction_codegen.cpp | 38 +++++++++++++++ ...ribute_parallel_for_simd_loop_messages.cpp | 2 +- test/OpenMP/distribute_simd_loop_messages.cpp | 2 +- test/OpenMP/for_codegen.cpp | 12 +++++ test/OpenMP/for_linear_codegen.cpp | 1 + test/OpenMP/for_loop_messages.cpp | 2 +- test/OpenMP/for_simd_loop_messages.cpp | 2 +- test/OpenMP/ordered_messages.cpp | 8 ++++ test/OpenMP/parallel_for_loop_messages.cpp | 2 +- .../parallel_for_simd_loop_messages.cpp | 2 +- test/OpenMP/parallel_reduction_codegen.cpp | 8 ++++ test/OpenMP/simd_loop_messages.cpp | 2 +- .../target_parallel_for_loop_messages.cpp | 2 +- ...target_parallel_for_simd_loop_messages.cpp | 2 +- test/OpenMP/target_simd_loop_messages.cpp | 2 +- .../target_teams_distribute_loop_messages.cpp | 2 +- ..._distribute_parallel_for_loop_messages.cpp | 2 +- ...ribute_parallel_for_simd_loop_messages.cpp | 2 +- ...et_teams_distribute_simd_loop_messages.cpp | 2 +- test/OpenMP/task_codegen.c | 30 ++++++++++++ test/OpenMP/taskloop_codegen.cpp | 4 ++ test/OpenMP/taskloop_loop_messages.cpp | 2 +- test/OpenMP/taskloop_simd_loop_messages.cpp | 2 +- .../OpenMP/teams_distribute_loop_messages.cpp | 2 +- ..._distribute_parallel_for_loop_messages.cpp | 2 +- ...ribute_parallel_for_simd_loop_messages.cpp | 2 +- .../teams_distribute_simd_loop_messages.cpp | 2 +- test/Preprocessor/predefined-arch-macros.c | 10 ++++ test/Sema/attr-selectany.c | 2 + test/SemaCXX/attr-selectany.cpp | 3 ++ tools/clang-format/clang-format.py | 2 +- 57 files changed, 339 insertions(+), 101 deletions(-) rename bindings/python/tests/{ => cindex}/test_exception_specification_kind.py (100%) create mode 100644 test/CodeGen/tbaa-vec.cpp create mode 100644 test/OpenMP/cancel_codegen_cleanup.cpp create mode 100644 test/OpenMP/task_codegen.c diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py index 236803a9ab9b..4069ab8650d6 100644 --- a/bindings/python/clang/cindex.py +++ b/bindings/python/clang/cindex.py @@ -207,7 +207,7 @@ def __del__(self): conf.lib.clang_disposeString(self) @staticmethod - def from_result(res, fn, args): + def from_result(res, fn=None, args=None): assert isinstance(res, _CXString) return conf.lib.clang_getCString(res) @@ -459,8 +459,7 @@ def disable_option(self): """The command-line option that disables this diagnostic.""" disable = _CXString() conf.lib.clang_getDiagnosticOption(self, byref(disable)) - - return conf.lib.clang_getCString(disable) + return _CXString.from_result(disable) def format(self, options=None): """ @@ -473,8 +472,7 @@ def format(self, options=None): options = conf.lib.clang_defaultDiagnosticDisplayOptions() if options & ~Diagnostic._FormatOptionsMask: raise ValueError('Invalid format options') - formatted = conf.lib.clang_formatDiagnostic(self, options) - return conf.lib.clang_getCString(formatted) + return conf.lib.clang_formatDiagnostic(self, options) def __repr__(self): return "" % ( diff --git a/bindings/python/tests/cindex/test_diagnostics.py b/bindings/python/tests/cindex/test_diagnostics.py index ba6e545e8b1a..23cbe89f6581 100644 --- a/bindings/python/tests/cindex/test_diagnostics.py +++ b/bindings/python/tests/cindex/test_diagnostics.py @@ -92,3 +92,11 @@ def test_diagnostic_children(): assert children[0].spelling.endswith('declared here') assert children[0].location.line == 1 assert children[0].location.column == 1 + +def test_diagnostic_string_repr(): + tu = get_tu('struct MissingSemicolon{}') + assert len(tu.diagnostics) == 1 + d = tu.diagnostics[0] + + assert repr(d) == ', spelling "expected \';\' after struct">' + diff --git a/bindings/python/tests/test_exception_specification_kind.py b/bindings/python/tests/cindex/test_exception_specification_kind.py similarity index 100% rename from bindings/python/tests/test_exception_specification_kind.py rename to bindings/python/tests/cindex/test_exception_specification_kind.py diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index f13e13b0107b..5c69635b9492 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -2459,9 +2459,9 @@ def DLLImport : InheritableAttr, TargetSpecificAttr { let Documentation = [DLLImportDocs]; } -def SelectAny : InheritableAttr, TargetSpecificAttr { +def SelectAny : InheritableAttr { let Spellings = [Declspec<"selectany">, GCC<"selectany">]; - let Documentation = [Undocumented]; + let Documentation = [SelectAnyDocs]; } def Thread : Attr { diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td index 33ef3ea4cade..567c7a3a53b0 100644 --- a/include/clang/Basic/AttrDocs.td +++ b/include/clang/Basic/AttrDocs.td @@ -3106,3 +3106,18 @@ This attribute can be added to an Objective-C ``@interface`` declaration to ensure that this class cannot be subclassed. }]; } + + +def SelectAnyDocs : Documentation { + let Category = DocCatType; + let Content = [{ +This attribute appertains to a global symbol, causing it to have a weak +definition ( +`linkonce `_ +), allowing the linker to select any definition. + +For more information see +`gcc documentation `_ +or `msvc documentation `_. +}]; +} diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 6d3a478ac360..2f8f8919e5b3 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -976,7 +976,6 @@ TARGET_BUILTIN(__builtin_ia32_pmuludq512, "V8LLiV16iV16i", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_ptestmd512, "UsV16iV16iUs", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_ptestmq512, "UcV8LLiV8LLiUc", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_pbroadcastd512_gpr_mask, "V16iiV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pbroadcastq512_mem_mask, "V8LLiLLiV8LLiUc", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_loaddqusi512_mask, "V16iiC*V16iUs", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_loaddqudi512_mask, "V8LLiLLiC*V8LLiUc", "", "avx512f") TARGET_BUILTIN(__builtin_ia32_loadups512_mask, "V16ffC*V16fUs", "", "avx512f") diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 6456913a1549..8dc6e7b460e8 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -8830,7 +8830,7 @@ def err_omp_firstprivate_distribute_in_teams_reduction : Error< def err_omp_depend_clause_thread_simd : Error< "'depend' clauses cannot be mixed with '%0' clause">; def err_omp_depend_sink_expected_loop_iteration : Error< - "expected %0 loop iteration variable">; + "expected%select{| %1}0 loop iteration variable">; def err_omp_depend_sink_unexpected_expr : Error< "unexpected expression: number of expressions is larger than the number of associated loops">; def err_omp_depend_sink_expected_plus_minus : Error< diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index a26b608082f5..792e8cc4a518 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -537,7 +537,7 @@ namespace { /// rules. For example, the RHS of (0 && foo()) is not evaluated. We can /// evaluate the expression regardless of what the RHS is, but C only allows /// certain things in certain situations. - struct LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) EvalInfo { + struct EvalInfo { ASTContext &Ctx; /// EvalStatus - Contains information about the evaluation. @@ -977,24 +977,22 @@ namespace { /// RAII object used to optionally suppress diagnostics and side-effects from /// a speculative evaluation. class SpeculativeEvaluationRAII { - /// Pair of EvalInfo, and a bit that stores whether or not we were - /// speculatively evaluating when we created this RAII. - llvm::PointerIntPair InfoAndOldSpecEval; - Expr::EvalStatus Old; + EvalInfo *Info = nullptr; + Expr::EvalStatus OldStatus; + bool OldIsSpeculativelyEvaluating; void moveFromAndCancel(SpeculativeEvaluationRAII &&Other) { - InfoAndOldSpecEval = Other.InfoAndOldSpecEval; - Old = Other.Old; - Other.InfoAndOldSpecEval.setPointer(nullptr); + Info = Other.Info; + OldStatus = Other.OldStatus; + Other.Info = nullptr; } void maybeRestoreState() { - EvalInfo *Info = InfoAndOldSpecEval.getPointer(); if (!Info) return; - Info->EvalStatus = Old; - Info->IsSpeculativelyEvaluating = InfoAndOldSpecEval.getInt(); + Info->EvalStatus = OldStatus; + Info->IsSpeculativelyEvaluating = OldIsSpeculativelyEvaluating; } public: @@ -1002,8 +1000,8 @@ namespace { SpeculativeEvaluationRAII( EvalInfo &Info, SmallVectorImpl *NewDiag = nullptr) - : InfoAndOldSpecEval(&Info, Info.IsSpeculativelyEvaluating), - Old(Info.EvalStatus) { + : Info(&Info), OldStatus(Info.EvalStatus), + OldIsSpeculativelyEvaluating(Info.IsSpeculativelyEvaluating) { Info.EvalStatus.Diag = NewDiag; Info.IsSpeculativelyEvaluating = true; } diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 5d75aa5a7528..b33ab135816d 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -2169,7 +2169,7 @@ class AMDGPUTargetInfo final : public TargetInfo { public: AMDGPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : TargetInfo(Triple) , - GPU(isAMDGCN(Triple) ? GK_GFX6 : GK_R600), + GPU(isAMDGCN(Triple) ? GK_GFX6 : parseR600Name(Opts.CPU)), hasFP64(false), hasFMAF(false), hasLDEXPF(false), @@ -2179,6 +2179,12 @@ class AMDGPUTargetInfo final : public TargetInfo { hasFMAF = true; hasLDEXPF = true; } + if (getTriple().getArch() == llvm::Triple::r600) { + if (GPU == GK_EVERGREEN_DOUBLE_OPS || GPU == GK_CAYMAN) { + hasFMAF = true; + } + } + auto IsGenericZero = isGenericZero(Triple); resetDataLayout(getTriple().getArch() == llvm::Triple::amdgcn ? (IsGenericZero ? DataLayoutStringSIGenericIsZero : @@ -9350,8 +9356,7 @@ class AVRTargetInfo : public TargetInfo { WIntType = SignedInt; Char32Type = UnsignedLong; SigAtomicType = SignedChar; - resetDataLayout("e-p:16:16:16-i8:8:8-i16:16:16-i32:32:32-i64:64:64" - "-f32:32:32-f64:64:64-n8"); + resetDataLayout("e-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"); } void getTargetDefines(const LangOptions &Opts, diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp index 509c4a9ea052..3fd322483392 100644 --- a/lib/Basic/Version.cpp +++ b/lib/Basic/Version.cpp @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_500/final/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_50/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 9572bd3543bd..63c7b3d10bf9 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -3309,12 +3309,7 @@ static Address emitOMPArraySectionBase(CodeGenFunction &CGF, const Expr *Base, LValue CodeGenFunction::EmitOMPArraySectionExpr(const OMPArraySectionExpr *E, bool IsLowerBound) { - QualType BaseTy; - if (auto *ASE = - dyn_cast(E->getBase()->IgnoreParenImpCasts())) - BaseTy = OMPArraySectionExpr::getBaseOriginalType(ASE); - else - BaseTy = E->getBase()->getType(); + QualType BaseTy = OMPArraySectionExpr::getBaseOriginalType(E->getBase()); QualType ResultExprTy; if (auto *AT = getContext().getAsArrayType(BaseTy)) ResultExprTy = AT->getElementType(); @@ -3619,8 +3614,9 @@ LValue CodeGenFunction::EmitLValueForField(LValue base, getFieldAlignmentSource(BaseInfo.getAlignmentSource()); LValueBaseInfo FieldBaseInfo(fieldAlignSource, BaseInfo.getMayAlias()); + QualType type = field->getType(); const RecordDecl *rec = field->getParent(); - if (rec->isUnion() || rec->hasAttr()) + if (rec->isUnion() || rec->hasAttr() || type->isVectorType()) FieldBaseInfo.setMayAlias(true); bool mayAlias = FieldBaseInfo.getMayAlias(); @@ -3645,7 +3641,6 @@ LValue CodeGenFunction::EmitLValueForField(LValue base, return LValue::MakeBitfield(Addr, Info, fieldType, FieldBaseInfo); } - QualType type = field->getType(); Address addr = base.getAddress(); unsigned cvr = base.getVRQualifiers(); bool TBAAPath = CGM.getCodeGenOpts().StructPathTBAA; diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index d488bd4b30bf..9f8aa6c8d964 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -264,6 +264,13 @@ class CGOpenMPInlinedRegionInfo : public CGOpenMPRegionInfo { return nullptr; } + /// \brief Get an LValue for the current ThreadID variable. + LValue getThreadIDVariableLValue(CodeGenFunction &CGF) override { + if (OuterRegionInfo) + return OuterRegionInfo->getThreadIDVariableLValue(CGF); + llvm_unreachable("No LValue for inlined OpenMP construct"); + } + /// \brief Get the name of the capture helper. StringRef getHelperName() const override { if (auto *OuterRegionInfo = getOldCSI()) @@ -771,7 +778,8 @@ static void emitInitWithReductionInitializer(CodeGenFunction &CGF, /// \param Init Initial expression of array. /// \param SrcAddr Address of the original array. static void EmitOMPAggregateInit(CodeGenFunction &CGF, Address DestAddr, - QualType Type, const Expr *Init, + QualType Type, bool EmitDeclareReductionInit, + const Expr *Init, const OMPDeclareReductionDecl *DRD, Address SrcAddr = Address::invalid()) { // Perform element-by-element initialization. @@ -825,7 +833,7 @@ static void EmitOMPAggregateInit(CodeGenFunction &CGF, Address DestAddr, // Emit copy. { CodeGenFunction::RunCleanupsScope InitScope(CGF); - if (DRD && (DRD->getInitializer() || !Init)) { + if (EmitDeclareReductionInit) { emitInitWithReductionInitializer(CGF, DRD, Init, DestElementCurrent, SrcElementCurrent, ElementTy); } else @@ -883,8 +891,12 @@ void ReductionCodeGen::emitAggregateInitialization( // captured region. auto *PrivateVD = cast(cast(ClausesData[N].Private)->getDecl()); + bool EmitDeclareReductionInit = + DRD && (DRD->getInitializer() || !PrivateVD->hasInit()); EmitOMPAggregateInit(CGF, PrivateAddr, PrivateVD->getType(), - DRD ? ClausesData[N].ReductionOp : PrivateVD->getInit(), + EmitDeclareReductionInit, + EmitDeclareReductionInit ? ClausesData[N].ReductionOp + : PrivateVD->getInit(), DRD, SharedLVal.getAddress()); } @@ -4244,9 +4256,20 @@ CGOpenMPRuntime::emitTaskInit(CodeGenFunction &CGF, SourceLocation Loc, // Build type kmp_routine_entry_t (if not built yet). emitKmpRoutineEntryT(KmpInt32Ty); // Build type kmp_task_t (if not built yet). - if (KmpTaskTQTy.isNull()) { - KmpTaskTQTy = C.getRecordType(createKmpTaskTRecordDecl( - CGM, D.getDirectiveKind(), KmpInt32Ty, KmpRoutineEntryPtrQTy)); + if (isOpenMPTaskLoopDirective(D.getDirectiveKind())) { + if (SavedKmpTaskloopTQTy.isNull()) { + SavedKmpTaskloopTQTy = C.getRecordType(createKmpTaskTRecordDecl( + CGM, D.getDirectiveKind(), KmpInt32Ty, KmpRoutineEntryPtrQTy)); + } + KmpTaskTQTy = SavedKmpTaskloopTQTy; + } else if (D.getDirectiveKind() == OMPD_task) { + assert(D.getDirectiveKind() == OMPD_task && + "Expected taskloop or task directive"); + if (SavedKmpTaskTQTy.isNull()) { + SavedKmpTaskTQTy = C.getRecordType(createKmpTaskTRecordDecl( + CGM, D.getDirectiveKind(), KmpInt32Ty, KmpRoutineEntryPtrQTy)); + } + KmpTaskTQTy = SavedKmpTaskTQTy; } auto *KmpTaskTQTyRD = cast(KmpTaskTQTy->getAsTagDecl()); // Build particular struct kmp_task_t for the given task. diff --git a/lib/CodeGen/CGOpenMPRuntime.h b/lib/CodeGen/CGOpenMPRuntime.h index 5dcf999bea37..185c01d5e540 100644 --- a/lib/CodeGen/CGOpenMPRuntime.h +++ b/lib/CodeGen/CGOpenMPRuntime.h @@ -313,6 +313,10 @@ class CGOpenMPRuntime { /// deconstructors of firstprivate C++ objects */ /// } kmp_task_t; QualType KmpTaskTQTy; + /// Saved kmp_task_t for task directive. + QualType SavedKmpTaskTQTy; + /// Saved kmp_task_t for taskloop-based directive. + QualType SavedKmpTaskloopTQTy; /// \brief Type typedef struct kmp_depend_info { /// kmp_intptr_t base_addr; /// size_t len; diff --git a/lib/CodeGen/CGStmtOpenMP.cpp b/lib/CodeGen/CGStmtOpenMP.cpp index 6135cf31d176..cf430f860fd8 100644 --- a/lib/CodeGen/CGStmtOpenMP.cpp +++ b/lib/CodeGen/CGStmtOpenMP.cpp @@ -1210,12 +1210,14 @@ void CodeGenFunction::EmitOMPInnerLoop( EmitBlock(LoopExit.getBlock()); } -void CodeGenFunction::EmitOMPLinearClauseInit(const OMPLoopDirective &D) { +bool CodeGenFunction::EmitOMPLinearClauseInit(const OMPLoopDirective &D) { if (!HaveInsertPoint()) - return; + return false; // Emit inits for the linear variables. + bool HasLinears = false; for (const auto *C : D.getClausesOfKind()) { for (auto *Init : C->inits()) { + HasLinears = true; auto *VD = cast(cast(Init)->getDecl()); if (auto *Ref = dyn_cast(VD->getInit()->IgnoreImpCasts())) { AutoVarEmission Emission = EmitAutoVarAlloca(*VD); @@ -1240,6 +1242,7 @@ void CodeGenFunction::EmitOMPLinearClauseInit(const OMPLoopDirective &D) { EmitIgnoredExpr(CS); } } + return HasLinears; } void CodeGenFunction::EmitOMPLinearClauseFinal( @@ -1529,7 +1532,7 @@ void CodeGenFunction::EmitOMPSimdDirective(const OMPSimdDirective &S) { CGF.EmitOMPSimdInit(S); emitAlignedClause(CGF, S); - CGF.EmitOMPLinearClauseInit(S); + (void)CGF.EmitOMPLinearClauseInit(S); { OMPPrivateScope LoopScope(CGF); CGF.EmitOMPPrivateLoopCounters(S, LoopScope); @@ -2147,7 +2150,7 @@ bool CodeGenFunction::EmitOMPWorksharingLoop( llvm::DenseSet EmittedFinals; emitAlignedClause(*this, S); - EmitOMPLinearClauseInit(S); + bool HasLinears = EmitOMPLinearClauseInit(S); // Emit helper vars inits. std::pair Bounds = CodeGenLoopBounds(*this, S); @@ -2161,7 +2164,7 @@ bool CodeGenFunction::EmitOMPWorksharingLoop( // Emit 'then' code. { OMPPrivateScope LoopScope(*this); - if (EmitOMPFirstprivateClause(S, LoopScope)) { + if (EmitOMPFirstprivateClause(S, LoopScope) || HasLinears) { // Emit implicit barrier to synchronize threads and avoid data races on // initialization of firstprivate variables and post-update of // lastprivate variables. diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 753dd92f3071..6a1fa487ed14 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -1116,7 +1116,7 @@ class CodeGenFunction : public CodeGenTypeCache { auto IP = CGF.Builder.saveAndClearIP(); CGF.EmitBlock(Stack.back().ExitBlock.getBlock()); CodeGen(CGF); - CGF.EmitBranchThroughCleanup(Stack.back().ContBlock); + CGF.EmitBranch(Stack.back().ContBlock.getBlock()); CGF.Builder.restoreIP(IP); Stack.back().HasBeenEmitted = true; } @@ -2761,7 +2761,9 @@ class CodeGenFunction : public CodeGenTypeCache { /// and initializes them with the values according to OpenMP standard. /// /// \param D Directive (possibly) with the 'linear' clause. - void EmitOMPLinearClauseInit(const OMPLoopDirective &D); + /// \return true if at least one linear variable is found that should be + /// initialized with the value of the original variable, false otherwise. + bool EmitOMPLinearClauseInit(const OMPLoopDirective &D); typedef const llvm::function_refgetValue())) - D.Diag(diag::err_drv_invalid_thread_model_for_target) - << A->getValue() << A->getAsString(Args); - std::string CandidateLibPath = getArchSpecificLibPath(); if (getVFS().exists(CandidateLibPath)) getFilePaths().push_back(CandidateLibPath); diff --git a/lib/Driver/ToolChains/BareMetal.cpp b/lib/Driver/ToolChains/BareMetal.cpp index 5dc6dfad927b..28e4f5b0e583 100644 --- a/lib/Driver/ToolChains/BareMetal.cpp +++ b/lib/Driver/ToolChains/BareMetal.cpp @@ -65,14 +65,6 @@ Tool *BareMetal::buildLinker() const { return new tools::baremetal::Linker(*this); } -std::string BareMetal::getThreadModel() const { - return "single"; -} - -bool BareMetal::isThreadModelSupported(const StringRef Model) const { - return Model == "single"; -} - std::string BareMetal::getRuntimesDir() const { SmallString<128> Dir(getDriver().ResourceDir); llvm::sys::path::append(Dir, "lib", "baremetal"); diff --git a/lib/Driver/ToolChains/BareMetal.h b/lib/Driver/ToolChains/BareMetal.h index 4b74899fa53e..5e9fd9bffdb9 100644 --- a/lib/Driver/ToolChains/BareMetal.h +++ b/lib/Driver/ToolChains/BareMetal.h @@ -38,8 +38,6 @@ class LLVM_LIBRARY_VISIBILITY BareMetal : public ToolChain { bool isPICDefaultForced() const override { return false; } bool SupportsProfiling() const override { return false; } bool SupportsObjCGC() const override { return false; } - std::string getThreadModel() const override; - bool isThreadModelSupported(const StringRef Model) const override; RuntimeLibType GetDefaultRuntimeLibType() const override { return ToolChain::RLT_CompilerRT; diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index 6a6b90f86825..497f0b493261 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -2227,8 +2227,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } CmdArgs.push_back("-mthread-model"); - if (Arg *A = Args.getLastArg(options::OPT_mthread_model)) + if (Arg *A = Args.getLastArg(options::OPT_mthread_model)) { + if (!getToolChain().isThreadModelSupported(A->getValue())) + D.Diag(diag::err_drv_invalid_thread_model_for_target) + << A->getValue() << A->getAsString(Args); CmdArgs.push_back(A->getValue()); + } else CmdArgs.push_back(Args.MakeArgString(getToolChain().getThreadModel())); diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index aa4ed8c42a70..6fe5be2c815d 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -506,7 +506,7 @@ static FormatStyle expandPresets(const FormatStyle &Style) { Expanded.BraceWrapping.AfterFunction = true; Expanded.BraceWrapping.AfterStruct = true; Expanded.BraceWrapping.AfterUnion = true; - Expanded.BraceWrapping.SplitEmptyFunction = false; + Expanded.BraceWrapping.SplitEmptyFunction = true; Expanded.BraceWrapping.SplitEmptyRecord = false; break; case FormatStyle::BS_Stroustrup: diff --git a/lib/Headers/avx512fintrin.h b/lib/Headers/avx512fintrin.h index 4ce694531100..4b66acc02fa9 100644 --- a/lib/Headers/avx512fintrin.h +++ b/lib/Headers/avx512fintrin.h @@ -267,21 +267,16 @@ _mm512_maskz_set1_epi32(__mmask16 __M, int __A) __M); } +#ifdef __x86_64__ static __inline __m512i __DEFAULT_FN_ATTRS _mm512_maskz_set1_epi64(__mmask8 __M, long long __A) { -#ifdef __x86_64__ return (__m512i) __builtin_ia32_pbroadcastq512_gpr_mask (__A, (__v8di) _mm512_setzero_si512 (), __M); -#else - return (__m512i) __builtin_ia32_pbroadcastq512_mem_mask (__A, - (__v8di) - _mm512_setzero_si512 (), - __M); -#endif } +#endif static __inline __m512 __DEFAULT_FN_ATTRS _mm512_setzero_ps(void) diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index 01f574b6aeeb..1ae6f9d6c19c 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -3111,8 +3111,8 @@ bool OpenMPIterationSpaceChecker::SetStep(Expr *NewStep, bool Subtract) { if (!NewStep->isValueDependent()) { // Check that the step is integer expression. SourceLocation StepLoc = NewStep->getLocStart(); - ExprResult Val = - SemaRef.PerformOpenMPImplicitIntegerConversion(StepLoc, NewStep); + ExprResult Val = SemaRef.PerformOpenMPImplicitIntegerConversion( + StepLoc, getExprAsWritten(NewStep)); if (Val.isInvalid()) return true; NewStep = Val.get(); @@ -8858,7 +8858,8 @@ buildDeclareReductionRef(Sema &SemaRef, SourceLocation Loc, SourceRange Range, PrevD = D; } } - if (Ty->isDependentType() || Ty->isInstantiationDependentType() || + if (SemaRef.CurContext->isDependentContext() || Ty->isDependentType() || + Ty->isInstantiationDependentType() || Ty->containsUnexpandedParameterPack() || filterLookupForUDR(Lookups, [](ValueDecl *D) -> bool { return !D->isInvalidDecl() && @@ -10226,9 +10227,14 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind, if (!CurContext->isDependentContext() && DSAStack->getParentOrderedRegionParam() && DepCounter != DSAStack->isParentLoopControlVariable(D).first) { - Diag(ELoc, diag::err_omp_depend_sink_expected_loop_iteration) - << DSAStack->getParentLoopControlVariable( - DepCounter.getZExtValue()); + ValueDecl* VD = DSAStack->getParentLoopControlVariable( + DepCounter.getZExtValue()); + if (VD) { + Diag(ELoc, diag::err_omp_depend_sink_expected_loop_iteration) + << 1 << VD; + } else { + Diag(ELoc, diag::err_omp_depend_sink_expected_loop_iteration) << 0; + } continue; } OpsOffs.push_back({RHS, OOK}); @@ -10258,8 +10264,9 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind, if (!CurContext->isDependentContext() && DepKind == OMPC_DEPEND_sink && TotalDepCount > VarList.size() && - DSAStack->getParentOrderedRegionParam()) { - Diag(EndLoc, diag::err_omp_depend_sink_expected_loop_iteration) + DSAStack->getParentOrderedRegionParam() && + DSAStack->getParentLoopControlVariable(VarList.size() + 1)) { + Diag(EndLoc, diag::err_omp_depend_sink_expected_loop_iteration) << 1 << DSAStack->getParentLoopControlVariable(VarList.size() + 1); } if (DepKind != OMPC_DEPEND_source && DepKind != OMPC_DEPEND_sink && diff --git a/test/CodeGen/avx512f-builtins.c b/test/CodeGen/avx512f-builtins.c index c3356461a348..1ce09df7caf7 100644 --- a/test/CodeGen/avx512f-builtins.c +++ b/test/CodeGen/avx512f-builtins.c @@ -7929,6 +7929,13 @@ __m512i test_mm512_mask_set1_epi64 (__m512i __O, __mmask8 __M, long long __A) //CHECK: @llvm.x86.avx512.mask.pbroadcast.q.gpr.512 return _mm512_mask_set1_epi64 (__O, __M, __A); } + +__m512i test_mm512_maskz_set1_epi64 (__mmask8 __M, long long __A) +{ + //CHECK-LABEL: @test_mm512_maskz_set1_epi64 + //CHECK: @llvm.x86.avx512.mask.pbroadcast.q.gpr.512 + return _mm512_maskz_set1_epi64 (__M, __A); +} #endif __m512i test_mm512_set_epi64 (long long __A, long long __B, long long __C, diff --git a/test/CodeGen/tbaa-vec.cpp b/test/CodeGen/tbaa-vec.cpp new file mode 100644 index 000000000000..5f61b934f00e --- /dev/null +++ b/test/CodeGen/tbaa-vec.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -disable-llvm-passes %s -emit-llvm -o - | FileCheck %s +// Test TBAA metadata generated by front-end (vector types are always treated as mayalias). + +typedef float __m128 __attribute__ ((__vector_size__ (16))); + +struct A { + __m128 a, b; +}; + +void foo(A *a, __m128 v) { + // CHECK-LABEL: define void @_Z3fooP1ADv4_f + a->a = v; + // CHECK: store <4 x float> %v, <4 x float>* %{{.*}}, align 16, !tbaa [[TAG_char:!.*]] + // CHECK: store <4 x float> %{{.*}}, <4 x float>* %{{.*}}, align 16, !tbaa [[TAG_char]] +} + +// CHECK: [[TYPE_char:!.*]] = !{!"omnipotent char", [[TAG_cxx_tbaa:!.*]], +// CHECK: [[TAG_cxx_tbaa]] = !{!"Simple C++ TBAA"} +// CHECK: [[TAG_char]] = !{[[TYPE_char]], [[TYPE_char]], i64 0} + diff --git a/test/Driver/baremetal.cpp b/test/Driver/baremetal.cpp index ec78b9136371..58fa9914d62c 100644 --- a/test/Driver/baremetal.cpp +++ b/test/Driver/baremetal.cpp @@ -74,4 +74,12 @@ // RUN: %clangxx -target arm-none-eabi -v 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL -// CHECK-THREAD-MODEL: Thread model: single +// CHECK-THREAD-MODEL: Thread model: posix + +// RUN: %clangxx -target arm-none-eabi -mthread-model single -v 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-SINGLE +// CHECK-THREAD-MODEL-SINGLE: Thread model: single + +// RUN: %clangxx -target arm-none-eabi -mthread-model posix -v 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-POSIX +// CHECK-THREAD-MODEL-POSIX: Thread model: posix diff --git a/test/OpenMP/cancel_codegen_cleanup.cpp b/test/OpenMP/cancel_codegen_cleanup.cpp new file mode 100644 index 000000000000..5a297bd377b1 --- /dev/null +++ b/test/OpenMP/cancel_codegen_cleanup.cpp @@ -0,0 +1,46 @@ +// RUN: %clang_cc1 -std=c++11 -fopenmp -fopenmp-version=45 -triple x86_64-apple-darwin13.4.0 -emit-llvm -o - %s | FileCheck %s + +//CHECK: call i32 @__kmpc_cancel +//CHECK: br {{.*}}label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]] +//CHECK: [[EXIT]]: +//CHECK: store i32 [[EXIT_SLOT:[0-9]+]] +//CHECK: br label %[[CLEANUP:.+]] +//CHECK: [[CONTINUE]]: +//CHECK: store i32 [[CONT_SLOT:[0-9]+]], +//CHECK: br label %[[CLEANUP]] +//CHECK: [[CLEANUP]]: +//CHECK-NEXT: call void @_ZN3ObjD1Ev +//CHECK: switch i32{{.*}}, label %[[UNREACHABLE:.+]] [ +//CHECK: i32 [[CONT_SLOT]], label %[[CLEANUPCONT:.+]] +//CHECK: i32 [[EXIT_SLOT]], label %[[CANCELEXIT:.+]] +//CHECK-NEXT: ] +//CHECK: [[CLEANUPCONT]]: +//CHECK: br label %[[CANCELCONT:.+]] +//CHECK: [[CANCELCONT]]: +//CHECK-NEXT: call void @__kmpc_barrier( +//CHECK-NEXT: ret void +//CHECK: [[UNREACHABLE]]: +//CHECK-NEXT: unreachable +//CHECK-NEXT: } + +struct Obj { + int a; Obj(); Obj(const Obj& r) = delete; Obj &operator=(const Obj& r); + ~Obj(); +}; + +void foo() { + int i,count = 0; + Obj obj; + + #pragma omp parallel private(i) num_threads(1) + { + #pragma omp for reduction(+:count) lastprivate(obj) + for (i=0; i<1000; i++) { + if(i==100) { + obj.a = 100; + #pragma omp cancel for + } + count++; + } + } +} diff --git a/test/OpenMP/declare_reduction_codegen.cpp b/test/OpenMP/declare_reduction_codegen.cpp index 11ce4300118c..ae6e047d9483 100644 --- a/test/OpenMP/declare_reduction_codegen.cpp +++ b/test/OpenMP/declare_reduction_codegen.cpp @@ -9,6 +9,26 @@ // CHECK: [[SSS_INT:.+]] = type { i32 } // CHECK-LOAD: [[SSS_INT:.+]] = type { i32 } +// CHECK: add +void add(short &out, short &in) {} + +#pragma omp declare reduction(my_add : short : add(omp_out, omp_in)) + +// CHECK: define internal void @. +// CHECK: call void @{{.+}}add{{.+}}( +// CHECK: ret void + +// CHECK: foo_reduction_array +void foo_reduction_array() { + short y[1]; + // CHECK: call void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call( +#pragma omp parallel for reduction(my_add : y) + for (int i = 0; i < 1; i++) { + } +} + +// CHECK: define internal void @ + #pragma omp declare reduction(+ : int, char : omp_out *= omp_in) // CHECK: define internal {{.*}}void @{{[^(]+}}(i32* noalias, i32* noalias) // CHECK: [[MUL:%.+]] = mul nsw i32 @@ -92,6 +112,22 @@ T foo(T a) { return a; } +struct Summary { + void merge(const Summary& other) {} +}; + +template +void work() { + Summary global_summary; +#pragma omp declare reduction(+ : Summary : omp_out.merge(omp_in)) +#pragma omp parallel for reduction(+ : global_summary) + for (int k = 1; k <= 100; ++k) { + } +} + +struct A {}; + + // CHECK-LABEL: @main int main() { int i = 0; @@ -110,6 +146,8 @@ int main() { // CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call( // CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call( // CHECK: call {{.*}}void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call({{[^@]*}} @{{[^@]*}}[[REGION:@[^ ]+]] + // CHECK-LABEL: work + work(); // CHECK-LABEL: foo return foo(15); } diff --git a/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp index 6c322e6f60be..1fedb3c02d79 100644 --- a/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_loop_messages.cpp @@ -702,7 +702,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/distribute_simd_loop_messages.cpp b/test/OpenMP/distribute_simd_loop_messages.cpp index b69005578f49..59fafda45f4b 100644 --- a/test/OpenMP/distribute_simd_loop_messages.cpp +++ b/test/OpenMP/distribute_simd_loop_messages.cpp @@ -691,7 +691,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/for_codegen.cpp b/test/OpenMP/for_codegen.cpp index b27bd7b1dbe5..466139cfb2fc 100644 --- a/test/OpenMP/for_codegen.cpp +++ b/test/OpenMP/for_codegen.cpp @@ -484,6 +484,18 @@ void loop_with_It(It begin, It end) { // CHECK: call void @__kmpc_for_static_init_8( // CHECK: call void @__kmpc_for_static_fini( +void loop_with_It_plus(It begin, It end) { +#pragma omp for + for (It it = begin; it < end; it+=1u) { + *it = 0; + } +} + +// CHECK-LABEL: loop_with_It_plus +// CHECK: call i32 @__kmpc_global_thread_num( +// CHECK: call void @__kmpc_for_static_init_8( +// CHECK: call void @__kmpc_for_static_fini( + void loop_with_stmt_expr() { #pragma omp for for (int i = __extension__({float b = 0;b; }); i < __extension__({double c = 1;c; }); i += __extension__({char d = 1; d; })) diff --git a/test/OpenMP/for_linear_codegen.cpp b/test/OpenMP/for_linear_codegen.cpp index acadccbce389..16a67c0b91d2 100644 --- a/test/OpenMP/for_linear_codegen.cpp +++ b/test/OpenMP/for_linear_codegen.cpp @@ -422,6 +422,7 @@ int main() { // CHECK: [[A_PRIV:%.+]] = alloca i{{[0-9]+}}, // CHECK: [[B_PRIV:%.+]] = alloca i{{[0-9]+}}, // CHECK: [[C_PRIV:%.+]] = alloca i{{[0-9]+}}, +// CHECK: call void @__kmpc_barrier( // CHECK: store i{{[0-9]+}}* [[A_PRIV]], i{{[0-9]+}}** [[REFA:%.+]], // CHECK: store i{{[0-9]+}}* [[C_PRIV]], i{{[0-9]+}}** [[REFC:%.+]], // CHECK: call void @__kmpc_for_static_init_4( diff --git a/test/OpenMP/for_loop_messages.cpp b/test/OpenMP/for_loop_messages.cpp index bb58a77e5ade..01cc6020b85f 100644 --- a/test/OpenMP/for_loop_messages.cpp +++ b/test/OpenMP/for_loop_messages.cpp @@ -660,7 +660,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/for_simd_loop_messages.cpp b/test/OpenMP/for_simd_loop_messages.cpp index e9729a8fc26d..ea17a836cf80 100644 --- a/test/OpenMP/for_simd_loop_messages.cpp +++ b/test/OpenMP/for_simd_loop_messages.cpp @@ -624,7 +624,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/ordered_messages.cpp b/test/OpenMP/ordered_messages.cpp index eb2c18e4690c..2e3d55ca8370 100644 --- a/test/OpenMP/ordered_messages.cpp +++ b/test/OpenMP/ordered_messages.cpp @@ -270,5 +270,13 @@ int k; } } +#pragma omp for ordered(2) // expected-note {{as specified in 'ordered' clause}} + for (int i = 0; i < 10; ++i) { // expected-error {{expected 2 for loops after '#pragma omp for', but found only 1}} +#pragma omp ordered depend(sink : i) + int j; +#pragma omp ordered depend(sink : i, j) // expected-error {{expected loop iteration variable}} + foo(); + } + return foo(); // expected-note {{in instantiation of function template specialization 'foo' requested here}} } diff --git a/test/OpenMP/parallel_for_loop_messages.cpp b/test/OpenMP/parallel_for_loop_messages.cpp index 7e136e75869c..cf1f6195cc86 100644 --- a/test/OpenMP/parallel_for_loop_messages.cpp +++ b/test/OpenMP/parallel_for_loop_messages.cpp @@ -539,7 +539,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/parallel_for_simd_loop_messages.cpp b/test/OpenMP/parallel_for_simd_loop_messages.cpp index 403e951d53c4..7feb4b0eb6ee 100644 --- a/test/OpenMP/parallel_for_simd_loop_messages.cpp +++ b/test/OpenMP/parallel_for_simd_loop_messages.cpp @@ -540,7 +540,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/parallel_reduction_codegen.cpp b/test/OpenMP/parallel_reduction_codegen.cpp index e42776c740b5..c4c0ff473a59 100644 --- a/test/OpenMP/parallel_reduction_codegen.cpp +++ b/test/OpenMP/parallel_reduction_codegen.cpp @@ -80,6 +80,14 @@ struct SST { // CHECK-DAG: [[REDUCTION_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 18, i32 0, i32 0, i8* // CHECK-DAG: [[REDUCTION_LOCK:@.+]] = common global [8 x i32] zeroinitializer +//CHECK: foo_array_sect +//CHECK: call void {{.+}}@__kmpc_fork_call( +//CHECK: ret void +void foo_array_sect(short x[1]) { +#pragma omp parallel reduction(+ : x[:]) + {} +} + template T tmain() { T t; diff --git a/test/OpenMP/simd_loop_messages.cpp b/test/OpenMP/simd_loop_messages.cpp index 96b4cafc6bd8..a47ccbc87219 100644 --- a/test/OpenMP/simd_loop_messages.cpp +++ b/test/OpenMP/simd_loop_messages.cpp @@ -527,7 +527,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/target_parallel_for_loop_messages.cpp b/test/OpenMP/target_parallel_for_loop_messages.cpp index 0e8eab10b5cb..d7c189116bf0 100644 --- a/test/OpenMP/target_parallel_for_loop_messages.cpp +++ b/test/OpenMP/target_parallel_for_loop_messages.cpp @@ -539,7 +539,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/target_parallel_for_simd_loop_messages.cpp b/test/OpenMP/target_parallel_for_simd_loop_messages.cpp index c0dceeded454..ed184a5e4124 100644 --- a/test/OpenMP/target_parallel_for_simd_loop_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_loop_messages.cpp @@ -539,7 +539,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/target_simd_loop_messages.cpp b/test/OpenMP/target_simd_loop_messages.cpp index 67201fb73fa7..d33f1f4cdc65 100644 --- a/test/OpenMP/target_simd_loop_messages.cpp +++ b/test/OpenMP/target_simd_loop_messages.cpp @@ -541,7 +541,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/target_teams_distribute_loop_messages.cpp b/test/OpenMP/target_teams_distribute_loop_messages.cpp index cb243a66b1ae..441abcba0049 100644 --- a/test/OpenMP/target_teams_distribute_loop_messages.cpp +++ b/test/OpenMP/target_teams_distribute_loop_messages.cpp @@ -525,7 +525,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp index 83c78f2aac78..d912737a2146 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_loop_messages.cpp @@ -523,7 +523,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp index a6b6dd817358..0ed57baa5c3b 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_loop_messages.cpp @@ -526,7 +526,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp b/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp index 3ddabce5e8d7..aae00a4433bc 100644 --- a/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_loop_messages.cpp @@ -525,7 +525,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/task_codegen.c b/test/OpenMP/task_codegen.c new file mode 100644 index 000000000000..579a6f1b9229 --- /dev/null +++ b/test/OpenMP/task_codegen.c @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -x c -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s +// expected-no-diagnostics +#ifndef HEADER +#define HEADER + +void foo(); + +// CHECK-LABEL: @main +int main() { + // CHECK: call i32 @__kmpc_global_thread_num( + // CHECK: call i8* @__kmpc_omp_task_alloc( + // CHECK: call i32 @__kmpc_omp_task( +#pragma omp task + { +#pragma omp taskgroup + { +#pragma omp task + foo(); + } + } + // CHECK: ret i32 0 + return 0; +} +// CHECK: call void @__kmpc_taskgroup( +// CHECK: call i8* @__kmpc_omp_task_alloc( +// CHECK: call i32 @__kmpc_omp_task( +// CHECK: call void @__kmpc_end_taskgroup( +#endif diff --git a/test/OpenMP/taskloop_codegen.cpp b/test/OpenMP/taskloop_codegen.cpp index 8de52023f33d..94cf5365d872 100644 --- a/test/OpenMP/taskloop_codegen.cpp +++ b/test/OpenMP/taskloop_codegen.cpp @@ -8,6 +8,10 @@ // CHECK-LABEL: @main int main(int argc, char **argv) { // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(%ident_t* [[DEFLOC:@.+]]) +// CHECK: call i8* @__kmpc_omp_task_alloc(%ident_t* [[DEFLOC]], i32 [[GTID]], +// CHECK: call i32 @__kmpc_omp_task(%ident_t* [[DEFLOC]], i32 [[GTID]], +#pragma omp task + ; // CHECK: call void @__kmpc_taskgroup(%ident_t* [[DEFLOC]], i32 [[GTID]]) // CHECK: [[TASKV:%.+]] = call i8* @__kmpc_omp_task_alloc(%ident_t* [[DEFLOC]], i32 [[GTID]], i32 33, i64 80, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, [[TDP_TY:%.+]]*)* [[TASK1:@.+]] to i32 (i32, i8*)*)) // CHECK: [[TASK:%.+]] = bitcast i8* [[TASKV]] to [[TDP_TY]]* diff --git a/test/OpenMP/taskloop_loop_messages.cpp b/test/OpenMP/taskloop_loop_messages.cpp index 291cbdbe718c..edfc2a8dcde5 100644 --- a/test/OpenMP/taskloop_loop_messages.cpp +++ b/test/OpenMP/taskloop_loop_messages.cpp @@ -644,7 +644,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/taskloop_simd_loop_messages.cpp b/test/OpenMP/taskloop_simd_loop_messages.cpp index 3326e6ff61cd..502224629a56 100644 --- a/test/OpenMP/taskloop_simd_loop_messages.cpp +++ b/test/OpenMP/taskloop_simd_loop_messages.cpp @@ -645,7 +645,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/teams_distribute_loop_messages.cpp b/test/OpenMP/teams_distribute_loop_messages.cpp index dbfd9ef03cdb..ea2604eebf0f 100644 --- a/test/OpenMP/teams_distribute_loop_messages.cpp +++ b/test/OpenMP/teams_distribute_loop_messages.cpp @@ -607,7 +607,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp index ea392fb93ed3..e0c315f513b7 100644 --- a/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_loop_messages.cpp @@ -605,7 +605,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp index 675ecb407f4d..03325623502f 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_loop_messages.cpp @@ -607,7 +607,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/OpenMP/teams_distribute_simd_loop_messages.cpp b/test/OpenMP/teams_distribute_simd_loop_messages.cpp index 742bc7451e93..81fbfe860a70 100644 --- a/test/OpenMP/teams_distribute_simd_loop_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_loop_messages.cpp @@ -607,7 +607,7 @@ void test_with_template() { t1.dotest_lt(begin, end); t2.dotest_lt(begin, end); // expected-note {{in instantiation of member function 'TC::dotest_lt' requested here}} dotest_gt(begin, end); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} - dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} + dotest_gt(0, 100); // expected-note {{in instantiation of function template specialization 'dotest_gt' requested here}} } void test_loop_break() { diff --git a/test/Preprocessor/predefined-arch-macros.c b/test/Preprocessor/predefined-arch-macros.c index 8976f9e8fb27..85e78b661d47 100644 --- a/test/Preprocessor/predefined-arch-macros.c +++ b/test/Preprocessor/predefined-arch-macros.c @@ -2283,6 +2283,9 @@ // RUN: -target amdgcn-unknown-unknown \ // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_AMDGCN // CHECK_AMDGCN: #define __AMDGCN__ 1 +// CHECK_AMDGCN: #define __HAS_FMAF__ 1 +// CHECK_AMDGCN: #define __HAS_FP64__ 1 +// CHECK_AMDGCN: #define __HAS_LDEXPF__ 1 // Begin r600 tests ---------------- // @@ -2290,3 +2293,10 @@ // RUN: -target r600-unknown-unknown \ // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_R600 // CHECK_R600: #define __R600__ 1 +// CHECK_R600-NOT: #define __HAS_FMAF__ 1 + +// RUN: %clang -march=amdgcn -mcpu=cypress -E -dM %s -o - 2>&1 \ +// RUN: -target r600-unknown-unknown \ +// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_R600_FP64 +// CHECK_R600_FP64-DAG: #define __R600__ 1 +// CHECK_R600_FP64-DAG: #define __HAS_FMAF__ 1 diff --git a/test/Sema/attr-selectany.c b/test/Sema/attr-selectany.c index 9fa2fcade539..9d574d524f0a 100644 --- a/test/Sema/attr-selectany.c +++ b/test/Sema/attr-selectany.c @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-win32 -fdeclspec -verify %s // RUN: %clang_cc1 -triple x86_64-mingw32 -verify %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux -verify -fdeclspec %s +// RUN: %clang_cc1 -triple x86_64-win32-macho -verify -fdeclspec %s extern __declspec(selectany) const int x1 = 1; // no warning, const means we need extern in C++ diff --git a/test/SemaCXX/attr-selectany.cpp b/test/SemaCXX/attr-selectany.cpp index 62fca09ab364..4afcb8130a14 100644 --- a/test/SemaCXX/attr-selectany.cpp +++ b/test/SemaCXX/attr-selectany.cpp @@ -1,4 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-win32 -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s +// RUN: %clang_cc1 -triple x86_64-win32-macho -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s + // MSVC produces similar diagnostics. __declspec(selectany) void foo() { } // expected-error{{'selectany' can only be applied to data items with external linkage}} diff --git a/tools/clang-format/clang-format.py b/tools/clang-format/clang-format.py index 2412566346f2..187125ed09a8 100644 --- a/tools/clang-format/clang-format.py +++ b/tools/clang-format/clang-format.py @@ -62,7 +62,7 @@ def main(): # Determine range to format. if vim.eval('exists("l:lines")') == '1': - lines = vim.eval('l:lines') + lines = ['-lines', vim.eval('l:lines')] elif vim.eval('exists("l:formatdiff")') == '1': with open(vim.current.buffer.name, 'r') as f: ondisk = f.read().splitlines(); From dbabdb5220c44e5938d404eefb84b5ed55667ea8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 2 Dec 2017 12:47:11 +0000 Subject: [PATCH 3/5] Vendor import of libc++ release_50 branch r319231: https://llvm.org/svn/llvm-project/libcxx/branches/release_50@319231 --- include/algorithm | 5 +- include/deque | 5 +- include/functional | 36 +- include/list | 13 +- include/string | 12 +- include/type_traits | 7 +- include/vector | 17 +- .../deque.cons/assign_iter_iter.pass.cpp | 53 ++- .../deque/deque.cons/iter_iter.pass.cpp | 51 ++- .../deque/deque.cons/iter_iter_alloc.pass.cpp | 53 ++- .../list/list.cons/input_iterator.pass.cpp | 182 ++++++++- .../vector.cons/assign_iter_iter.pass.cpp | 76 ++++ .../vector.cons/construct_iter_iter.pass.cpp | 155 +++++-- .../construct_iter_iter_alloc.pass.cpp | 162 ++++++-- .../size_size_string_view.pass.cpp | 383 ++++++++++++++++++ .../string_compare/string_view.pass.cpp | 79 ++++ .../string_view_size.pass.cpp | 159 ++++++++ .../string_view_size.pass.cpp | 159 ++++++++ .../string_view_size.pass.cpp | 159 ++++++++ .../string_view_size.pass.cpp | 159 ++++++++ .../string_find/string_view_size.pass.cpp | 159 ++++++++ .../string_rfind/string_view_size.pass.cpp | 159 ++++++++ .../func.wrap.func.con/F_incomplete.pass.cpp | 39 +- test/support/container_test_types.h | 28 +- test/support/emplace_constructible.h | 74 ++++ 25 files changed, 2275 insertions(+), 109 deletions(-) create mode 100644 test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp create mode 100644 test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp create mode 100644 test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp create mode 100644 test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp create mode 100644 test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp create mode 100644 test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp create mode 100644 test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp create mode 100644 test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp create mode 100644 test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp create mode 100644 test/support/emplace_constructible.h diff --git a/include/algorithm b/include/algorithm index 4542275adfda..00db6d7e7c87 100644 --- a/include/algorithm +++ b/include/algorithm @@ -3013,6 +3013,7 @@ template _UIntType __independent_bits_engine<_Engine, _UIntType>::__eval(true_type) { + const size_t _WRt = numeric_limits::digits; result_type _Sp = 0; for (size_t __k = 0; __k < __n0_; ++__k) { @@ -3021,7 +3022,7 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type) { __u = __e_() - _Engine::min(); } while (__u >= __y0_); - if (__w0_ < _WDt) + if (__w0_ < _WRt) _Sp <<= __w0_; else _Sp = 0; @@ -3034,7 +3035,7 @@ __independent_bits_engine<_Engine, _UIntType>::__eval(true_type) { __u = __e_() - _Engine::min(); } while (__u >= __y1_); - if (__w0_ < _WDt - 1) + if (__w0_ < _WRt - 1) _Sp <<= __w0_ + 1; else _Sp = 0; diff --git a/include/deque b/include/deque index f795b489edc6..fee75614b97f 100644 --- a/include/deque +++ b/include/deque @@ -1356,7 +1356,6 @@ public: iterator insert(const_iterator __p, initializer_list __il) {return insert(__p, __il.begin(), __il.end());} #endif // _LIBCPP_CXX03_LANG - iterator insert(const_iterator __p, const value_type& __v); iterator insert(const_iterator __p, size_type __n, const value_type& __v); template @@ -2224,7 +2223,11 @@ deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIter __l, !__is_forward_iterator<_InpIter>::value>::type*) { for (; __f != __l; ++__f) +#ifdef _LIBCPP_CXX03_LANG push_back(*__f); +#else + emplace_back(*__f); +#endif } template diff --git a/include/functional b/include/functional index 83a2e5a39a88..f73c3ca56a8e 100644 --- a/include/functional +++ b/include/functional @@ -1597,9 +1597,11 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> return reinterpret_cast<__base*>(p); } - template ::value && - __invokable<_Fp&, _ArgTypes...>::value> - struct __callable; + template , function>::value>, + __invokable<_Fp&, _ArgTypes...> + >::value> + struct __callable; template struct __callable<_Fp, true> { @@ -1612,6 +1614,9 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> { static const bool value = false; }; + + template + using _EnableIfCallable = typename enable_if<__callable<_Fp>::value>::type; public: typedef _Rp result_type; @@ -1622,9 +1627,7 @@ public: function(nullptr_t) _NOEXCEPT : __f_(0) {} function(const function&); function(function&&) _NOEXCEPT; - template::value && !is_same<_Fp, function>::value - >::type> + template> function(_Fp); #if _LIBCPP_STD_VER <= 14 @@ -1638,21 +1641,15 @@ public: function(allocator_arg_t, const _Alloc&, const function&); template function(allocator_arg_t, const _Alloc&, function&&); - template::value>::type> + template> function(allocator_arg_t, const _Alloc& __a, _Fp __f); #endif function& operator=(const function&); function& operator=(function&&) _NOEXCEPT; function& operator=(nullptr_t) _NOEXCEPT; - template - typename enable_if - < - __callable::type>::value && - !is_same::type, function>::value, - function& - >::type - operator=(_Fp&&); + template> + function& operator=(_Fp&&); ~function(); @@ -1854,13 +1851,8 @@ function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT } template -template -typename enable_if -< - function<_Rp(_ArgTypes...)>::template __callable::type>::value && - !is_same::type, function<_Rp(_ArgTypes...)>>::value, - function<_Rp(_ArgTypes...)>& ->::type +template +function<_Rp(_ArgTypes...)>& function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f) { function(_VSTD::forward<_Fp>(__f)).swap(*this); diff --git a/include/list b/include/list index 20a66c36002d..9c70fff946c7 100644 --- a/include/list +++ b/include/list @@ -992,6 +992,15 @@ public: void push_front(const value_type& __x); void push_back(const value_type& __x); +#ifndef _LIBCPP_CXX03_LANG + template + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(_Arg&& __arg) { emplace_back(_VSTD::forward<_Arg>(__arg)); } +#else + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(value_type const& __arg) { push_back(__arg); } +#endif + iterator insert(const_iterator __p, const value_type& __x); iterator insert(const_iterator __p, size_type __n, const value_type& __x); template @@ -1189,7 +1198,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, __get_db()->__insert_c(this); #endif for (; __f != __l; ++__f) - push_back(*__f); + __emplace_back(*__f); } template @@ -1202,7 +1211,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a, __get_db()->__insert_c(this); #endif for (; __f != __l; ++__f) - push_back(*__f); + __emplace_back(*__f); } template diff --git a/include/string b/include/string index 610f19ecba26..7775587a42d9 100644 --- a/include/string +++ b/include/string @@ -259,7 +259,7 @@ public: size_type find(value_type c, size_type pos = 0) const noexcept; size_type rfind(const basic_string& str, size_type pos = npos) const noexcept; - size_type ffind(basic_string_view sv, size_type pos = 0) const noexcept; + size_type rfind(basic_string_view sv, size_type pos = npos) const noexcept; size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept; size_type rfind(const value_type* s, size_type pos = npos) const noexcept; size_type rfind(value_type c, size_type pos = npos) const noexcept; @@ -271,7 +271,7 @@ public: size_type find_first_of(value_type c, size_type pos = 0) const noexcept; size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept; - size_type find_last_of(basic_string_view sv, size_type pos = 0) const noexcept; + size_type find_last_of(basic_string_view sv, size_type pos = npos) const noexcept; size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept; size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept; size_type find_last_of(value_type c, size_type pos = npos) const noexcept; @@ -283,7 +283,7 @@ public: size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept; size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept; - size_type find_last_not_of(basic_string_view sv, size_type pos = 0) const noexcept; + size_type find_last_not_of(basic_string_view sv, size_type pos = npos) const noexcept; size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept; size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept; size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept; @@ -1147,7 +1147,7 @@ public: _LIBCPP_INLINE_VISIBILITY size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type rfind(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type rfind(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; @@ -1166,7 +1166,7 @@ public: _LIBCPP_INLINE_VISIBILITY size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type find_last_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type find_last_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; @@ -1186,7 +1186,7 @@ public: _LIBCPP_INLINE_VISIBILITY size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - size_type find_last_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + size_type find_last_not_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; diff --git a/include/type_traits b/include/type_traits index 9db4d66145fc..6c111abfd1e8 100644 --- a/include/type_traits +++ b/include/type_traits @@ -4339,8 +4339,8 @@ struct __invokable_r using _Result = decltype( _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)); - static const bool value = - conditional< + using type = + typename conditional< !is_same<_Result, __nat>::value, typename conditional< is_void<_Ret>::value, @@ -4348,7 +4348,8 @@ struct __invokable_r is_convertible<_Result, _Ret> >::type, false_type - >::type::value; + >::type; + static const bool value = type::value; }; template diff --git a/include/vector b/include/vector index 6e9920a0f80f..b2f8f092c63d 100644 --- a/include/vector +++ b/include/vector @@ -674,6 +674,17 @@ public: const value_type* data() const _NOEXCEPT {return _VSTD::__to_raw_pointer(this->__begin_);} +#ifdef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(const value_type& __x) { push_back(__x); } +#else + template + _LIBCPP_INLINE_VISIBILITY + void __emplace_back(_Arg&& __arg) { + emplace_back(_VSTD::forward<_Arg>(__arg)); + } +#endif + _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); #ifndef _LIBCPP_CXX03_LANG @@ -1128,7 +1139,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, __get_db()->__insert_c(this); #endif for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template @@ -1145,7 +1156,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, c __get_db()->__insert_c(this); #endif for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template @@ -1365,7 +1376,7 @@ vector<_Tp, _Allocator>::assign(_InputIterator __first, _InputIterator __last) { clear(); for (; __first != __last; ++__first) - push_back(*__first); + __emplace_back(*__first); } template diff --git a/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp index f06067786cfd..940d4e8d6815 100644 --- a/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp +++ b/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp @@ -19,6 +19,9 @@ #include "test_macros.h" #include "test_iterators.h" #include "min_allocator.h" +#if TEST_STD_VER >= 11 +#include "emplace_constructible.h" +#endif template C @@ -80,7 +83,7 @@ testNI(int start, int N, int M) testI(c1, c2); } -int main() +void basic_test() { { int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049}; @@ -103,3 +106,51 @@ int main() } #endif } + +void test_emplacable_concept() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using T = EmplaceConstructibleMoveableAndAssignable; + using It = random_access_iterator; + { + std::deque v; + v.assign(It(arr1), It(std::end(arr1))); + assert(v[0].value == 42); + } + { + std::deque v; + v.assign(It(arr2), It(std::end(arr2))); + assert(v[0].value == 1); + assert(v[1].value == 101); + assert(v[2].value == 42); + } + } + { + using T = EmplaceConstructibleMoveableAndAssignable; + using It = input_iterator; + { + std::deque v; + v.assign(It(arr1), It(std::end(arr1))); + assert(v[0].copied == 0); + assert(v[0].value == 42); + } + { + std::deque v; + v.assign(It(arr2), It(std::end(arr2))); + //assert(v[0].copied == 0); + assert(v[0].value == 1); + //assert(v[1].copied == 0); + assert(v[1].value == 101); + assert(v[2].copied == 0); + assert(v[2].value == 42); + } + } +#endif +} + +int main() { + basic_test(); + test_emplacable_concept(); +} diff --git a/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp index 87445c5b2b67..793f2b12a2de 100644 --- a/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp +++ b/test/std/containers/sequences/deque/deque.cons/iter_iter.pass.cpp @@ -15,9 +15,13 @@ #include #include +#include "test_macros.h" #include "test_allocator.h" #include "test_iterators.h" #include "min_allocator.h" +#if TEST_STD_VER >= 11 +#include "emplace_constructible.h" +#endif template void @@ -48,7 +52,7 @@ test(InputIterator f, InputIterator l) assert(*i == *f); } -int main() +void basic_test() { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; int* an = ab + sizeof(ab)/sizeof(ab[0]); @@ -61,3 +65,48 @@ int main() test >(ab, an); #endif } + + +void test_emplacable_concept() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using T = EmplaceConstructibleAndMoveable; + using It = random_access_iterator; + { + std::deque v(It(arr1), It(std::end(arr1))); + assert(v[0].value == 42); + } + { + std::deque v(It(arr2), It(std::end(arr2))); + assert(v[0].value == 1); + assert(v[1].value == 101); + assert(v[2].value == 42); + } + } + { + using T = EmplaceConstructibleAndMoveable; + using It = input_iterator; + { + std::deque v(It(arr1), It(std::end(arr1))); + assert(v[0].copied == 0); + assert(v[0].value == 42); + } + { + std::deque v(It(arr2), It(std::end(arr2))); + //assert(v[0].copied == 0); + assert(v[0].value == 1); + //assert(v[1].copied == 0); + assert(v[1].value == 101); + assert(v[2].copied == 0); + assert(v[2].value == 42); + } + } +#endif +} + +int main() { + basic_test(); + test_emplacable_concept(); +} diff --git a/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp index 54227ebc12d8..9ac342a8f767 100644 --- a/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp +++ b/test/std/containers/sequences/deque/deque.cons/iter_iter_alloc.pass.cpp @@ -16,9 +16,13 @@ #include #include +#include "test_macros.h" #include "test_iterators.h" #include "test_allocator.h" #include "min_allocator.h" +#if TEST_STD_VER >= 11 +#include "emplace_constructible.h" +#endif template void @@ -35,7 +39,7 @@ test(InputIterator f, InputIterator l, const Allocator& a) assert(*i == *f); } -int main() +void basic_test() { int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; int* an = ab + sizeof(ab)/sizeof(ab[0]); @@ -50,3 +54,50 @@ int main() test(random_access_iterator(ab), random_access_iterator(an), min_allocator()); #endif } + + +void test_emplacable_concept() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using T = EmplaceConstructibleAndMoveable; + using It = random_access_iterator; + std::allocator a; + { + std::deque v(It(arr1), It(std::end(arr1)), a); + assert(v[0].value == 42); + } + { + std::deque v(It(arr2), It(std::end(arr2)), a); + assert(v[0].value == 1); + assert(v[1].value == 101); + assert(v[2].value == 42); + } + } + { + using T = EmplaceConstructibleAndMoveable; + using It = input_iterator; + std::allocator a; + { + std::deque v(It(arr1), It(std::end(arr1)), a); + assert(v[0].copied == 0); + assert(v[0].value == 42); + } + { + std::deque v(It(arr2), It(std::end(arr2)), a); + //assert(v[0].copied == 0); + assert(v[0].value == 1); + //assert(v[1].copied == 0); + assert(v[1].value == 101); + assert(v[2].copied == 0); + assert(v[2].value == 42); + } + } +#endif +} + +int main() { + basic_test(); + test_emplacable_concept(); +} diff --git a/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp b/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp index 3b3c2f7ef1ab..3cdcc73627b8 100644 --- a/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp +++ b/test/std/containers/sequences/list/list.cons/input_iterator.pass.cpp @@ -17,8 +17,12 @@ #include "test_iterators.h" #include "test_allocator.h" #include "min_allocator.h" +#if TEST_STD_VER >= 11 +#include "emplace_constructible.h" +#include "container_test_types.h" +#endif -int main() +void basic_test() { { int a[] = {0, 1, 2, 3}; @@ -76,3 +80,179 @@ int main() } #endif } + + + +void test_emplacable_concept() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using T = EmplaceConstructible; + using It = random_access_iterator; + { + std::list v(It(arr1), It(std::end(arr1))); + auto I = v.begin(); + assert(I->value == 42); + } + { + std::list v(It(arr2), It(std::end(arr2))); + auto I = v.begin(); + assert(I->value == 1); + ++I; + assert(I->value == 101); + ++I; + assert(I->value == 42); + } + } + { + using T = EmplaceConstructible; + using It = input_iterator; + { + std::list v(It(arr1), It(std::end(arr1))); + auto I = v.begin(); + assert(I->value == 42); + } + { + std::list v(It(arr2), It(std::end(arr2))); + auto I = v.begin(); + //assert(v[0].copied == 0); + assert(I->value == 1); + //assert(v[1].copied == 0); + ++I; + assert(I->value == 101); + ++I; + assert(I->value == 42); + } + } +#endif +} + + + +void test_emplacable_concept_with_alloc() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using T = EmplaceConstructible; + using It = random_access_iterator; + std::allocator a; + { + std::list v(It(arr1), It(std::end(arr1)), a); + auto I = v.begin(); + assert(I->value == 42); + } + { + std::list v(It(arr2), It(std::end(arr2)), a); + auto I = v.begin(); + assert(I->value == 1); + ++I; + assert(I->value == 101); + ++I; + assert(I->value == 42); + } + } + { + using T = EmplaceConstructible; + using It = input_iterator; + std::allocator a; + { + std::list v(It(arr1), It(std::end(arr1)), a); + auto I = v.begin(); + assert(I->value == 42); + } + { + std::list v(It(arr2), It(std::end(arr2)), a); + auto I = v.begin(); + //assert(v[0].copied == 0); + assert(I->value == 1); + //assert(v[1].copied == 0); + ++I; + assert(I->value == 101); + ++I; + assert(I->value == 42); + } + } +#endif +} + +void test_ctor_under_alloc() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using C = TCT::list<>; + using T = typename C::value_type; + using It = forward_iterator; + { + ExpectConstructGuard G(1); + C v(It(arr1), It(std::end(arr1))); + } + { + ExpectConstructGuard G(3); + C v(It(arr2), It(std::end(arr2))); + } + } + { + using C = TCT::list<>; + using T = typename C::value_type; + using It = input_iterator; + { + ExpectConstructGuard G(1); + C v(It(arr1), It(std::end(arr1))); + } + { + ExpectConstructGuard G(3); + C v(It(arr2), It(std::end(arr2))); + } + } +#endif +} + +void test_ctor_under_alloc_with_alloc() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using C = TCT::list<>; + using T = typename C::value_type; + using It = forward_iterator; + using Alloc = typename C::allocator_type; + Alloc a; + { + ExpectConstructGuard G(1); + C v(It(arr1), It(std::end(arr1)), a); + } + { + ExpectConstructGuard G(3); + C v(It(arr2), It(std::end(arr2)), a); + } + } + { + using C = TCT::list<>; + using T = typename C::value_type; + using It = input_iterator; + using Alloc = typename C::allocator_type; + Alloc a; + { + ExpectConstructGuard G(1); + C v(It(arr1), It(std::end(arr1)), a); + } + { + ExpectConstructGuard G(3); + C v(It(arr2), It(std::end(arr2)), a); + } + } +#endif +} + + + +int main() { + basic_test(); + test_emplacable_concept(); + test_emplacable_concept_with_alloc(); + test_ctor_under_alloc(); + test_ctor_under_alloc_with_alloc(); +} diff --git a/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp new file mode 100644 index 000000000000..f07495637aa7 --- /dev/null +++ b/test/std/containers/sequences/vector/vector.cons/assign_iter_iter.pass.cpp @@ -0,0 +1,76 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// void assign(size_type n, const_reference v); + +#include +#include +#include +#include +#include "test_macros.h" +#include "min_allocator.h" +#include "asan_testing.h" +#include "test_iterators.h" +#if TEST_STD_VER >= 11 +#include "emplace_constructible.h" +#include "container_test_types.h" +#endif + + +void test_emplaceable_concept() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using T = EmplaceConstructibleMoveableAndAssignable; + using It = forward_iterator; + { + std::vector v; + v.assign(It(arr1), It(std::end(arr1))); + assert(v[0].value == 42); + } + { + std::vector v; + v.assign(It(arr2), It(std::end(arr2))); + assert(v[0].value == 1); + assert(v[1].value == 101); + assert(v[2].value == 42); + } + } + { + using T = EmplaceConstructibleMoveableAndAssignable; + using It = input_iterator; + { + std::vector v; + v.assign(It(arr1), It(std::end(arr1))); + assert(v[0].copied == 0); + assert(v[0].value == 42); + } + { + std::vector v; + v.assign(It(arr2), It(std::end(arr2))); + //assert(v[0].copied == 0); + assert(v[0].value == 1); + //assert(v[1].copied == 0); + assert(v[1].value == 101); + assert(v[2].copied == 0); + assert(v[2].value == 42); + } + } +#endif +} + + + +int main() +{ + test_emplaceable_concept(); +} diff --git a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp index ec4944d1ad1c..88613efe7a2b 100644 --- a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp @@ -20,40 +20,137 @@ #include "test_allocator.h" #include "min_allocator.h" #include "asan_testing.h" +#if TEST_STD_VER >= 11 +#include "emplace_constructible.h" +#include "container_test_types.h" +#endif template -void -test(Iterator first, Iterator last) -{ - C c(first, last); - LIBCPP_ASSERT(c.__invariants()); - assert(c.size() == static_cast(std::distance(first, last))); - LIBCPP_ASSERT(is_contiguous_container_asan_correct(c)); - for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first) - assert(*i == *first); +void test(Iterator first, Iterator last) { + C c(first, last); + LIBCPP_ASSERT(c.__invariants()); + assert(c.size() == static_cast(std::distance(first, last))); + LIBCPP_ASSERT(is_contiguous_container_asan_correct(c)); + for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; + ++i, ++first) + assert(*i == *first); } -int main() -{ - int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0}; - int* an = a + sizeof(a)/sizeof(a[0]); - test >(input_iterator(a), input_iterator(an)); - test >(forward_iterator(a), forward_iterator(an)); - test >(bidirectional_iterator(a), bidirectional_iterator(an)); - test >(random_access_iterator(a), random_access_iterator(an)); - test >(a, an); +static void basic_test_cases() { + int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0}; + int* an = a + sizeof(a) / sizeof(a[0]); + test >(input_iterator(a), + input_iterator(an)); + test >(forward_iterator(a), + forward_iterator(an)); + test >(bidirectional_iterator(a), + bidirectional_iterator(an)); + test >(random_access_iterator(a), + random_access_iterator(an)); + test >(a, an); - test > >(input_iterator(a), input_iterator(an)); - // Add 1 for implementations that dynamically allocate a container proxy. - test > >(forward_iterator(a), forward_iterator(an)); - test > >(bidirectional_iterator(a), bidirectional_iterator(an)); - test > >(random_access_iterator(a), random_access_iterator(an)); - test > >(a, an); + test > >( + input_iterator(a), input_iterator(an)); + // Add 1 for implementations that dynamically allocate a container proxy. + test > >( + forward_iterator(a), forward_iterator(an)); + test > >( + bidirectional_iterator(a), + bidirectional_iterator(an)); + test > >( + random_access_iterator(a), + random_access_iterator(an)); + test > >(a, an); #if TEST_STD_VER >= 11 - test> >(input_iterator(a), input_iterator(an)); - test> >(forward_iterator(a), forward_iterator(an)); - test> >(bidirectional_iterator(a), bidirectional_iterator(an)); - test> >(random_access_iterator(a), random_access_iterator(an)); - test >(a, an); + test > >(input_iterator(a), + input_iterator(an)); + test > >( + forward_iterator(a), forward_iterator(an)); + test > >( + bidirectional_iterator(a), + bidirectional_iterator(an)); + test > >( + random_access_iterator(a), + random_access_iterator(an)); + test >(a, an); #endif } + +void emplaceable_concept_tests() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using T = EmplaceConstructible; + using It = forward_iterator; + { + std::vector v(It(arr1), It(std::end(arr1))); + assert(v[0].value == 42); + } + { + std::vector v(It(arr2), It(std::end(arr2))); + assert(v[0].value == 1); + assert(v[1].value == 101); + assert(v[2].value == 42); + } + } + { + using T = EmplaceConstructibleAndMoveInsertable; + using It = input_iterator; + { + std::vector v(It(arr1), It(std::end(arr1))); + assert(v[0].copied == 0); + assert(v[0].value == 42); + } + { + std::vector v(It(arr2), It(std::end(arr2))); + //assert(v[0].copied == 0); + assert(v[0].value == 1); + //assert(v[1].copied == 0); + assert(v[1].value == 101); + assert(v[2].copied == 0); + assert(v[2].value == 42); + } + } +#endif +} + +void test_ctor_under_alloc() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using C = TCT::vector<>; + using T = typename C::value_type; + using It = forward_iterator; + { + ExpectConstructGuard G(1); + C v(It(arr1), It(std::end(arr1))); + } + { + ExpectConstructGuard G(3); + C v(It(arr2), It(std::end(arr2))); + } + } + { + using C = TCT::vector<>; + using T = typename C::value_type; + using It = input_iterator; + { + ExpectConstructGuard G(1); + C v(It(arr1), It(std::end(arr1))); + } + { + //ExpectConstructGuard G(3); + //C v(It(arr2), It(std::end(arr2)), a); + } + } +#endif +} + + +int main() { + basic_test_cases(); + emplaceable_concept_tests(); // See PR34898 + test_ctor_under_alloc(); +} diff --git a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp index b4482ddb2727..71743b31d44c 100644 --- a/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp +++ b/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp @@ -21,56 +21,152 @@ #include "test_allocator.h" #include "min_allocator.h" #include "asan_testing.h" +#if TEST_STD_VER >= 11 +#include "emplace_constructible.h" +#include "container_test_types.h" +#endif template -void -test(Iterator first, Iterator last, const A& a) -{ - C c(first, last, a); - LIBCPP_ASSERT(c.__invariants()); - assert(c.size() == static_cast(std::distance(first, last))); - LIBCPP_ASSERT(is_contiguous_container_asan_correct(c)); - for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; ++i, ++first) - assert(*i == *first); +void test(Iterator first, Iterator last, const A& a) { + C c(first, last, a); + LIBCPP_ASSERT(c.__invariants()); + assert(c.size() == static_cast(std::distance(first, last))); + LIBCPP_ASSERT(is_contiguous_container_asan_correct(c)); + for (typename C::const_iterator i = c.cbegin(), e = c.cend(); i != e; + ++i, ++first) + assert(*i == *first); } #if TEST_STD_VER >= 11 template -struct implicit_conv_allocator : min_allocator -{ - implicit_conv_allocator(void*) {} - implicit_conv_allocator(const implicit_conv_allocator&) = default; +struct implicit_conv_allocator : min_allocator { + implicit_conv_allocator(void*) {} + implicit_conv_allocator(const implicit_conv_allocator&) = default; - template - implicit_conv_allocator(implicit_conv_allocator) {} + template + implicit_conv_allocator(implicit_conv_allocator) {} }; #endif -int main() -{ - { +void basic_tests() { + { int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0}; - int* an = a + sizeof(a)/sizeof(a[0]); + int* an = a + sizeof(a) / sizeof(a[0]); std::allocator alloc; - test >(input_iterator(a), input_iterator(an), alloc); - test >(forward_iterator(a), forward_iterator(an), alloc); - test >(bidirectional_iterator(a), bidirectional_iterator(an), alloc); - test >(random_access_iterator(a), random_access_iterator(an), alloc); + test >(input_iterator(a), + input_iterator(an), alloc); + test >(forward_iterator(a), + forward_iterator(an), alloc); + test >(bidirectional_iterator(a), + bidirectional_iterator(an), alloc); + test >(random_access_iterator(a), + random_access_iterator(an), alloc); test >(a, an, alloc); - } + } #if TEST_STD_VER >= 11 - { + { int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0}; - int* an = a + sizeof(a)/sizeof(a[0]); + int* an = a + sizeof(a) / sizeof(a[0]); min_allocator alloc; - test> >(input_iterator(a), input_iterator(an), alloc); - test> >(forward_iterator(a), forward_iterator(an), alloc); - test> >(bidirectional_iterator(a), bidirectional_iterator(an), alloc); - test> >(random_access_iterator(a), random_access_iterator(an), alloc); - test> >(a, an, alloc); - test> >(a, an, nullptr); - } + test > >( + input_iterator(a), input_iterator(an), alloc); + test > >( + forward_iterator(a), forward_iterator(an), + alloc); + test > >( + bidirectional_iterator(a), + bidirectional_iterator(an), alloc); + test > >( + random_access_iterator(a), + random_access_iterator(an), alloc); + test > >(a, an, alloc); + test > >(a, an, nullptr); + } #endif } + +void emplaceable_concept_tests() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using T = EmplaceConstructible; + using It = forward_iterator; + using Alloc = std::allocator; + Alloc a; + { + std::vector v(It(arr1), It(std::end(arr1)), a); + assert(v[0].value == 42); + } + { + std::vector v(It(arr2), It(std::end(arr2)), a); + assert(v[0].value == 1); + assert(v[1].value == 101); + assert(v[2].value == 42); + } + } + { + using T = EmplaceConstructibleAndMoveInsertable; + using It = input_iterator; + using Alloc = std::allocator; + Alloc a; + { + std::vector v(It(arr1), It(std::end(arr1)), a); + assert(v[0].copied == 0); + assert(v[0].value == 42); + } + { + std::vector v(It(arr2), It(std::end(arr2)), a); + assert(v[0].value == 1); + assert(v[1].value == 101); + assert(v[2].copied == 0); + assert(v[2].value == 42); + } + } +#endif +} + +void test_ctor_under_alloc() { +#if TEST_STD_VER >= 11 + int arr1[] = {42}; + int arr2[] = {1, 101, 42}; + { + using C = TCT::vector<>; + using T = typename C::value_type; + using It = forward_iterator; + using Alloc = typename C::allocator_type; + Alloc a; + { + ExpectConstructGuard G(1); + C v(It(arr1), It(std::end(arr1)), a); + } + { + ExpectConstructGuard G(3); + C v(It(arr2), It(std::end(arr2)), a); + } + } + { + using C = TCT::vector<>; + using T = typename C::value_type; + using It = input_iterator; + using Alloc = typename C::allocator_type; + Alloc a; + { + ExpectConstructGuard G(1); + C v(It(arr1), It(std::end(arr1)), a); + } + { + //ExpectConstructGuard G(3); + //C v(It(arr2), It(std::end(arr2)), a); + } + } +#endif +} + +int main() { + basic_tests(); + emplaceable_concept_tests(); // See PR34898 + test_ctor_under_alloc(); +} diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp new file mode 100644 index 000000000000..6a5ba22cdc8d --- /dev/null +++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp @@ -0,0 +1,383 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// int compare(size_type pos1, size_type n1, basic_string_vew sv) const; + +#include +#include +#include + +#include "min_allocator.h" + +#include "test_macros.h" + +int sign(int x) +{ + if (x == 0) + return 0; + if (x < 0) + return -1; + return 1; +} + +template +void +test(const S& s, typename S::size_type pos1, typename S::size_type n1, + SV sv, int x) +{ + if (pos1 <= s.size()) + assert(sign(s.compare(pos1, n1, sv)) == sign(x)); +#ifndef TEST_HAS_NO_EXCEPTIONS + else + { + try + { + s.compare(pos1, n1, sv); + assert(false); + } + catch (std::out_of_range&) + { + assert(pos1 > s.size()); + } + } +#endif +} + +template +void test0() +{ + test(S(""), 0, 0, SV(""), 0); + test(S(""), 0, 0, SV("abcde"), -5); + test(S(""), 0, 0, SV("abcdefghij"), -10); + test(S(""), 0, 0, SV("abcdefghijklmnopqrst"), -20); + test(S(""), 0, 1, SV(""), 0); + test(S(""), 0, 1, SV("abcde"), -5); + test(S(""), 0, 1, SV("abcdefghij"), -10); + test(S(""), 0, 1, SV("abcdefghijklmnopqrst"), -20); + test(S(""), 1, 0, SV(""), 0); + test(S(""), 1, 0, SV("abcde"), 0); + test(S(""), 1, 0, SV("abcdefghij"), 0); + test(S(""), 1, 0, SV("abcdefghijklmnopqrst"), 0); + test(S("abcde"), 0, 0, SV(""), 0); + test(S("abcde"), 0, 0, SV("abcde"), -5); + test(S("abcde"), 0, 0, SV("abcdefghij"), -10); + test(S("abcde"), 0, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcde"), 0, 1, SV(""), 1); + test(S("abcde"), 0, 1, SV("abcde"), -4); + test(S("abcde"), 0, 1, SV("abcdefghij"), -9); + test(S("abcde"), 0, 1, SV("abcdefghijklmnopqrst"), -19); + test(S("abcde"), 0, 2, SV(""), 2); + test(S("abcde"), 0, 2, SV("abcde"), -3); + test(S("abcde"), 0, 2, SV("abcdefghij"), -8); + test(S("abcde"), 0, 2, SV("abcdefghijklmnopqrst"), -18); + test(S("abcde"), 0, 4, SV(""), 4); + test(S("abcde"), 0, 4, SV("abcde"), -1); + test(S("abcde"), 0, 4, SV("abcdefghij"), -6); + test(S("abcde"), 0, 4, SV("abcdefghijklmnopqrst"), -16); + test(S("abcde"), 0, 5, SV(""), 5); + test(S("abcde"), 0, 5, SV("abcde"), 0); + test(S("abcde"), 0, 5, SV("abcdefghij"), -5); + test(S("abcde"), 0, 5, SV("abcdefghijklmnopqrst"), -15); + test(S("abcde"), 0, 6, SV(""), 5); + test(S("abcde"), 0, 6, SV("abcde"), 0); + test(S("abcde"), 0, 6, SV("abcdefghij"), -5); + test(S("abcde"), 0, 6, SV("abcdefghijklmnopqrst"), -15); + test(S("abcde"), 1, 0, SV(""), 0); + test(S("abcde"), 1, 0, SV("abcde"), -5); + test(S("abcde"), 1, 0, SV("abcdefghij"), -10); + test(S("abcde"), 1, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcde"), 1, 1, SV(""), 1); + test(S("abcde"), 1, 1, SV("abcde"), 1); + test(S("abcde"), 1, 1, SV("abcdefghij"), 1); + test(S("abcde"), 1, 1, SV("abcdefghijklmnopqrst"), 1); + test(S("abcde"), 1, 2, SV(""), 2); + test(S("abcde"), 1, 2, SV("abcde"), 1); + test(S("abcde"), 1, 2, SV("abcdefghij"), 1); + test(S("abcde"), 1, 2, SV("abcdefghijklmnopqrst"), 1); + test(S("abcde"), 1, 3, SV(""), 3); + test(S("abcde"), 1, 3, SV("abcde"), 1); + test(S("abcde"), 1, 3, SV("abcdefghij"), 1); + test(S("abcde"), 1, 3, SV("abcdefghijklmnopqrst"), 1); + test(S("abcde"), 1, 4, SV(""), 4); + test(S("abcde"), 1, 4, SV("abcde"), 1); + test(S("abcde"), 1, 4, SV("abcdefghij"), 1); + test(S("abcde"), 1, 4, SV("abcdefghijklmnopqrst"), 1); + test(S("abcde"), 1, 5, SV(""), 4); + test(S("abcde"), 1, 5, SV("abcde"), 1); + test(S("abcde"), 1, 5, SV("abcdefghij"), 1); + test(S("abcde"), 1, 5, SV("abcdefghijklmnopqrst"), 1); + test(S("abcde"), 2, 0, SV(""), 0); + test(S("abcde"), 2, 0, SV("abcde"), -5); + test(S("abcde"), 2, 0, SV("abcdefghij"), -10); + test(S("abcde"), 2, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcde"), 2, 1, SV(""), 1); + test(S("abcde"), 2, 1, SV("abcde"), 2); + test(S("abcde"), 2, 1, SV("abcdefghij"), 2); + test(S("abcde"), 2, 1, SV("abcdefghijklmnopqrst"), 2); + test(S("abcde"), 2, 2, SV(""), 2); + test(S("abcde"), 2, 2, SV("abcde"), 2); + test(S("abcde"), 2, 2, SV("abcdefghij"), 2); + test(S("abcde"), 2, 2, SV("abcdefghijklmnopqrst"), 2); + test(S("abcde"), 2, 3, SV(""), 3); + test(S("abcde"), 2, 3, SV("abcde"), 2); + test(S("abcde"), 2, 3, SV("abcdefghij"), 2); + test(S("abcde"), 2, 3, SV("abcdefghijklmnopqrst"), 2); + test(S("abcde"), 2, 4, SV(""), 3); + test(S("abcde"), 2, 4, SV("abcde"), 2); + test(S("abcde"), 2, 4, SV("abcdefghij"), 2); + test(S("abcde"), 2, 4, SV("abcdefghijklmnopqrst"), 2); + test(S("abcde"), 4, 0, SV(""), 0); + test(S("abcde"), 4, 0, SV("abcde"), -5); + test(S("abcde"), 4, 0, SV("abcdefghij"), -10); + test(S("abcde"), 4, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcde"), 4, 1, SV(""), 1); + test(S("abcde"), 4, 1, SV("abcde"), 4); + test(S("abcde"), 4, 1, SV("abcdefghij"), 4); + test(S("abcde"), 4, 1, SV("abcdefghijklmnopqrst"), 4); + test(S("abcde"), 4, 2, SV(""), 1); + test(S("abcde"), 4, 2, SV("abcde"), 4); + test(S("abcde"), 4, 2, SV("abcdefghij"), 4); + test(S("abcde"), 4, 2, SV("abcdefghijklmnopqrst"), 4); + test(S("abcde"), 5, 0, SV(""), 0); + test(S("abcde"), 5, 0, SV("abcde"), -5); + test(S("abcde"), 5, 0, SV("abcdefghij"), -10); + test(S("abcde"), 5, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcde"), 5, 1, SV(""), 0); + test(S("abcde"), 5, 1, SV("abcde"), -5); + test(S("abcde"), 5, 1, SV("abcdefghij"), -10); + test(S("abcde"), 5, 1, SV("abcdefghijklmnopqrst"), -20); +} + +template +void test1() +{ + test(S("abcde"), 6, 0, SV(""), 0); + test(S("abcde"), 6, 0, SV("abcde"), 0); + test(S("abcde"), 6, 0, SV("abcdefghij"), 0); + test(S("abcde"), 6, 0, SV("abcdefghijklmnopqrst"), 0); + test(S("abcdefghij"), 0, 0, SV(""), 0); + test(S("abcdefghij"), 0, 0, SV("abcde"), -5); + test(S("abcdefghij"), 0, 0, SV("abcdefghij"), -10); + test(S("abcdefghij"), 0, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghij"), 0, 1, SV(""), 1); + test(S("abcdefghij"), 0, 1, SV("abcde"), -4); + test(S("abcdefghij"), 0, 1, SV("abcdefghij"), -9); + test(S("abcdefghij"), 0, 1, SV("abcdefghijklmnopqrst"), -19); + test(S("abcdefghij"), 0, 5, SV(""), 5); + test(S("abcdefghij"), 0, 5, SV("abcde"), 0); + test(S("abcdefghij"), 0, 5, SV("abcdefghij"), -5); + test(S("abcdefghij"), 0, 5, SV("abcdefghijklmnopqrst"), -15); + test(S("abcdefghij"), 0, 9, SV(""), 9); + test(S("abcdefghij"), 0, 9, SV("abcde"), 4); + test(S("abcdefghij"), 0, 9, SV("abcdefghij"), -1); + test(S("abcdefghij"), 0, 9, SV("abcdefghijklmnopqrst"), -11); + test(S("abcdefghij"), 0, 10, SV(""), 10); + test(S("abcdefghij"), 0, 10, SV("abcde"), 5); + test(S("abcdefghij"), 0, 10, SV("abcdefghij"), 0); + test(S("abcdefghij"), 0, 10, SV("abcdefghijklmnopqrst"), -10); + test(S("abcdefghij"), 0, 11, SV(""), 10); + test(S("abcdefghij"), 0, 11, SV("abcde"), 5); + test(S("abcdefghij"), 0, 11, SV("abcdefghij"), 0); + test(S("abcdefghij"), 0, 11, SV("abcdefghijklmnopqrst"), -10); + test(S("abcdefghij"), 1, 0, SV(""), 0); + test(S("abcdefghij"), 1, 0, SV("abcde"), -5); + test(S("abcdefghij"), 1, 0, SV("abcdefghij"), -10); + test(S("abcdefghij"), 1, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghij"), 1, 1, SV(""), 1); + test(S("abcdefghij"), 1, 1, SV("abcde"), 1); + test(S("abcdefghij"), 1, 1, SV("abcdefghij"), 1); + test(S("abcdefghij"), 1, 1, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghij"), 1, 4, SV(""), 4); + test(S("abcdefghij"), 1, 4, SV("abcde"), 1); + test(S("abcdefghij"), 1, 4, SV("abcdefghij"), 1); + test(S("abcdefghij"), 1, 4, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghij"), 1, 8, SV(""), 8); + test(S("abcdefghij"), 1, 8, SV("abcde"), 1); + test(S("abcdefghij"), 1, 8, SV("abcdefghij"), 1); + test(S("abcdefghij"), 1, 8, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghij"), 1, 9, SV(""), 9); + test(S("abcdefghij"), 1, 9, SV("abcde"), 1); + test(S("abcdefghij"), 1, 9, SV("abcdefghij"), 1); + test(S("abcdefghij"), 1, 9, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghij"), 1, 10, SV(""), 9); + test(S("abcdefghij"), 1, 10, SV("abcde"), 1); + test(S("abcdefghij"), 1, 10, SV("abcdefghij"), 1); + test(S("abcdefghij"), 1, 10, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghij"), 5, 0, SV(""), 0); + test(S("abcdefghij"), 5, 0, SV("abcde"), -5); + test(S("abcdefghij"), 5, 0, SV("abcdefghij"), -10); + test(S("abcdefghij"), 5, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghij"), 5, 1, SV(""), 1); + test(S("abcdefghij"), 5, 1, SV("abcde"), 5); + test(S("abcdefghij"), 5, 1, SV("abcdefghij"), 5); + test(S("abcdefghij"), 5, 1, SV("abcdefghijklmnopqrst"), 5); + test(S("abcdefghij"), 5, 2, SV(""), 2); + test(S("abcdefghij"), 5, 2, SV("abcde"), 5); + test(S("abcdefghij"), 5, 2, SV("abcdefghij"), 5); + test(S("abcdefghij"), 5, 2, SV("abcdefghijklmnopqrst"), 5); + test(S("abcdefghij"), 5, 4, SV(""), 4); + test(S("abcdefghij"), 5, 4, SV("abcde"), 5); + test(S("abcdefghij"), 5, 4, SV("abcdefghij"), 5); + test(S("abcdefghij"), 5, 4, SV("abcdefghijklmnopqrst"), 5); + test(S("abcdefghij"), 5, 5, SV(""), 5); + test(S("abcdefghij"), 5, 5, SV("abcde"), 5); + test(S("abcdefghij"), 5, 5, SV("abcdefghij"), 5); + test(S("abcdefghij"), 5, 5, SV("abcdefghijklmnopqrst"), 5); + test(S("abcdefghij"), 5, 6, SV(""), 5); + test(S("abcdefghij"), 5, 6, SV("abcde"), 5); + test(S("abcdefghij"), 5, 6, SV("abcdefghij"), 5); + test(S("abcdefghij"), 5, 6, SV("abcdefghijklmnopqrst"), 5); + test(S("abcdefghij"), 9, 0, SV(""), 0); + test(S("abcdefghij"), 9, 0, SV("abcde"), -5); + test(S("abcdefghij"), 9, 0, SV("abcdefghij"), -10); + test(S("abcdefghij"), 9, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghij"), 9, 1, SV(""), 1); + test(S("abcdefghij"), 9, 1, SV("abcde"), 9); + test(S("abcdefghij"), 9, 1, SV("abcdefghij"), 9); + test(S("abcdefghij"), 9, 1, SV("abcdefghijklmnopqrst"), 9); + test(S("abcdefghij"), 9, 2, SV(""), 1); + test(S("abcdefghij"), 9, 2, SV("abcde"), 9); + test(S("abcdefghij"), 9, 2, SV("abcdefghij"), 9); + test(S("abcdefghij"), 9, 2, SV("abcdefghijklmnopqrst"), 9); + test(S("abcdefghij"), 10, 0, SV(""), 0); + test(S("abcdefghij"), 10, 0, SV("abcde"), -5); + test(S("abcdefghij"), 10, 0, SV("abcdefghij"), -10); + test(S("abcdefghij"), 10, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghij"), 10, 1, SV(""), 0); + test(S("abcdefghij"), 10, 1, SV("abcde"), -5); + test(S("abcdefghij"), 10, 1, SV("abcdefghij"), -10); + test(S("abcdefghij"), 10, 1, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghij"), 11, 0, SV(""), 0); + test(S("abcdefghij"), 11, 0, SV("abcde"), 0); + test(S("abcdefghij"), 11, 0, SV("abcdefghij"), 0); + test(S("abcdefghij"), 11, 0, SV("abcdefghijklmnopqrst"), 0); +} + +template +void test2() +{ + test(S("abcdefghijklmnopqrst"), 0, 0, SV(""), 0); + test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcde"), -5); + test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghij"), -10); + test(S("abcdefghijklmnopqrst"), 0, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghijklmnopqrst"), 0, 1, SV(""), 1); + test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcde"), -4); + test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghij"), -9); + test(S("abcdefghijklmnopqrst"), 0, 1, SV("abcdefghijklmnopqrst"), -19); + test(S("abcdefghijklmnopqrst"), 0, 10, SV(""), 10); + test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcde"), 5); + test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghij"), 0); + test(S("abcdefghijklmnopqrst"), 0, 10, SV("abcdefghijklmnopqrst"), -10); + test(S("abcdefghijklmnopqrst"), 0, 19, SV(""), 19); + test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcde"), 14); + test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghij"), 9); + test(S("abcdefghijklmnopqrst"), 0, 19, SV("abcdefghijklmnopqrst"), -1); + test(S("abcdefghijklmnopqrst"), 0, 20, SV(""), 20); + test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcde"), 15); + test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), 0, 20, SV("abcdefghijklmnopqrst"), 0); + test(S("abcdefghijklmnopqrst"), 0, 21, SV(""), 20); + test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcde"), 15); + test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), 0, 21, SV("abcdefghijklmnopqrst"), 0); + test(S("abcdefghijklmnopqrst"), 1, 0, SV(""), 0); + test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcde"), -5); + test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghij"), -10); + test(S("abcdefghijklmnopqrst"), 1, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghijklmnopqrst"), 1, 1, SV(""), 1); + test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcde"), 1); + test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghij"), 1); + test(S("abcdefghijklmnopqrst"), 1, 1, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghijklmnopqrst"), 1, 9, SV(""), 9); + test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcde"), 1); + test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghij"), 1); + test(S("abcdefghijklmnopqrst"), 1, 9, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghijklmnopqrst"), 1, 18, SV(""), 18); + test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcde"), 1); + test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghij"), 1); + test(S("abcdefghijklmnopqrst"), 1, 18, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghijklmnopqrst"), 1, 19, SV(""), 19); + test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcde"), 1); + test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghij"), 1); + test(S("abcdefghijklmnopqrst"), 1, 19, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghijklmnopqrst"), 1, 20, SV(""), 19); + test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcde"), 1); + test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghij"), 1); + test(S("abcdefghijklmnopqrst"), 1, 20, SV("abcdefghijklmnopqrst"), 1); + test(S("abcdefghijklmnopqrst"), 10, 0, SV(""), 0); + test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcde"), -5); + test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghij"), -10); + test(S("abcdefghijklmnopqrst"), 10, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghijklmnopqrst"), 10, 1, SV(""), 1); + test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcde"), 10); + test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), 10, 1, SV("abcdefghijklmnopqrst"), 10); + test(S("abcdefghijklmnopqrst"), 10, 5, SV(""), 5); + test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcde"), 10); + test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), 10, 5, SV("abcdefghijklmnopqrst"), 10); + test(S("abcdefghijklmnopqrst"), 10, 9, SV(""), 9); + test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcde"), 10); + test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), 10, 9, SV("abcdefghijklmnopqrst"), 10); + test(S("abcdefghijklmnopqrst"), 10, 10, SV(""), 10); + test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcde"), 10); + test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), 10, 10, SV("abcdefghijklmnopqrst"), 10); + test(S("abcdefghijklmnopqrst"), 10, 11, SV(""), 10); + test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcde"), 10); + test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), 10, 11, SV("abcdefghijklmnopqrst"), 10); + test(S("abcdefghijklmnopqrst"), 19, 0, SV(""), 0); + test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcde"), -5); + test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghij"), -10); + test(S("abcdefghijklmnopqrst"), 19, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghijklmnopqrst"), 19, 1, SV(""), 1); + test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcde"), 19); + test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghij"), 19); + test(S("abcdefghijklmnopqrst"), 19, 1, SV("abcdefghijklmnopqrst"), 19); + test(S("abcdefghijklmnopqrst"), 19, 2, SV(""), 1); + test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcde"), 19); + test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghij"), 19); + test(S("abcdefghijklmnopqrst"), 19, 2, SV("abcdefghijklmnopqrst"), 19); + test(S("abcdefghijklmnopqrst"), 20, 0, SV(""), 0); + test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcde"), -5); + test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghij"), -10); + test(S("abcdefghijklmnopqrst"), 20, 0, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghijklmnopqrst"), 20, 1, SV(""), 0); + test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcde"), -5); + test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghij"), -10); + test(S("abcdefghijklmnopqrst"), 20, 1, SV("abcdefghijklmnopqrst"), -20); + test(S("abcdefghijklmnopqrst"), 21, 0, SV(""), 0); + test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcde"), 0); + test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghij"), 0); + test(S("abcdefghijklmnopqrst"), 21, 0, SV("abcdefghijklmnopqrst"), 0); +} + +int main() +{ + { + typedef std::string S; + typedef std::string_view SV; + test0(); + test1(); + test2(); + } +#if TEST_STD_VER >= 11 + { + typedef std::basic_string, min_allocator> S; + typedef std::string_view SV; + test0(); + test1(); + test2(); + } +#endif +} diff --git a/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp new file mode 100644 index 000000000000..8f0d48884d74 --- /dev/null +++ b/test/std/strings/basic.string/string.ops/string_compare/string_view.pass.cpp @@ -0,0 +1,79 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// int compare(const basic_string_view sv) const + +#include +#include + +#include "min_allocator.h" + +int sign(int x) +{ + if (x == 0) + return 0; + if (x < 0) + return -1; + return 1; +} + +template +void +test(const S& s, SV sv, int x) +{ + assert(sign(s.compare(sv)) == sign(x)); +} + +int main() +{ + { + typedef std::string S; + typedef std::string_view SV; + test(S(""), SV(""), 0); + test(S(""), SV("abcde"), -5); + test(S(""), SV("abcdefghij"), -10); + test(S(""), SV("abcdefghijklmnopqrst"), -20); + test(S("abcde"), SV(""), 5); + test(S("abcde"), SV("abcde"), 0); + test(S("abcde"), SV("abcdefghij"), -5); + test(S("abcde"), SV("abcdefghijklmnopqrst"), -15); + test(S("abcdefghij"), SV(""), 10); + test(S("abcdefghij"), SV("abcde"), 5); + test(S("abcdefghij"), SV("abcdefghij"), 0); + test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), -10); + test(S("abcdefghijklmnopqrst"), SV(""), 20); + test(S("abcdefghijklmnopqrst"), SV("abcde"), 15); + test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), 0); + } +#if TEST_STD_VER >= 11 + { + typedef std::basic_string, min_allocator> S; + typedef std::string_view SV; + test(S(""), SV(""), 0); + test(S(""), SV("abcde"), -5); + test(S(""), SV("abcdefghij"), -10); + test(S(""), SV("abcdefghijklmnopqrst"), -20); + test(S("abcde"), SV(""), 5); + test(S("abcde"), SV("abcde"), 0); + test(S("abcde"), SV("abcdefghij"), -5); + test(S("abcde"), SV("abcdefghijklmnopqrst"), -15); + test(S("abcdefghij"), SV(""), 10); + test(S("abcdefghij"), SV("abcde"), 5); + test(S("abcdefghij"), SV("abcdefghij"), 0); + test(S("abcdefghij"), SV("abcdefghijklmnopqrst"), -10); + test(S("abcdefghijklmnopqrst"), SV(""), 20); + test(S("abcdefghijklmnopqrst"), SV("abcde"), 15); + test(S("abcdefghijklmnopqrst"), SV("abcdefghij"), 10); + test(S("abcdefghijklmnopqrst"), SV("abcdefghijklmnopqrst"), 0); + } +#endif +} diff --git a/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp new file mode 100644 index 000000000000..fb69f8b3410f --- /dev/null +++ b/test/std/strings/basic.string/string.ops/string_find.first.not.of/string_view_size.pass.cpp @@ -0,0 +1,159 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// size_type find_first_not_of(basic_string_view sv, size_type pos = 0) const; + +#include +#include + +#include "min_allocator.h" + +template +void +test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x) +{ + assert(s.find_first_not_of(sv, pos) == x); + if (x != S::npos) + assert(pos <= x && x < s.size()); +} + +template +void +test(const S& s, SV sv, typename S::size_type x) +{ + assert(s.find_first_not_of(sv) == x); + if (x != S::npos) + assert(x < s.size()); +} + +template +void test0() +{ + test(S(""), SV(""), 0, S::npos); + test(S(""), SV("laenf"), 0, S::npos); + test(S(""), SV("pqlnkmbdjo"), 0, S::npos); + test(S(""), SV("qkamfogpnljdcshbreti"), 0, S::npos); + test(S(""), SV(""), 1, S::npos); + test(S(""), SV("bjaht"), 1, S::npos); + test(S(""), SV("hjlcmgpket"), 1, S::npos); + test(S(""), SV("htaobedqikfplcgjsmrn"), 1, S::npos); + test(S("fodgq"), SV(""), 0, 0); + test(S("qanej"), SV("dfkap"), 0, 0); + test(S("clbao"), SV("ihqrfebgad"), 0, 0); + test(S("mekdn"), SV("ngtjfcalbseiqrphmkdo"), 0, S::npos); + test(S("srdfq"), SV(""), 1, 1); + test(S("oemth"), SV("ikcrq"), 1, 1); + test(S("cdaih"), SV("dmajblfhsg"), 1, 3); + test(S("qohtk"), SV("oqftjhdmkgsblacenirp"), 1, S::npos); + test(S("cshmd"), SV(""), 2, 2); + test(S("lhcdo"), SV("oebqi"), 2, 2); + test(S("qnsoh"), SV("kojhpmbsfe"), 2, S::npos); + test(S("pkrof"), SV("acbsjqogpltdkhinfrem"), 2, S::npos); + test(S("fmtsp"), SV(""), 4, 4); + test(S("khbpm"), SV("aobjd"), 4, 4); + test(S("pbsji"), SV("pcbahntsje"), 4, 4); + test(S("mprdj"), SV("fhepcrntkoagbmldqijs"), 4, S::npos); + test(S("eqmpa"), SV(""), 5, S::npos); + test(S("omigs"), SV("kocgb"), 5, S::npos); + test(S("onmje"), SV("fbslrjiqkm"), 5, S::npos); + test(S("oqmrj"), SV("jeidpcmalhfnqbgtrsko"), 5, S::npos); + test(S("schfa"), SV(""), 6, S::npos); + test(S("igdsc"), SV("qngpd"), 6, S::npos); + test(S("brqgo"), SV("rodhqklgmb"), 6, S::npos); + test(S("tnrph"), SV("thdjgafrlbkoiqcspmne"), 6, S::npos); + test(S("hcjitbfapl"), SV(""), 0, 0); + test(S("daiprenocl"), SV("ashjd"), 0, 2); + test(S("litpcfdghe"), SV("mgojkldsqh"), 0, 1); + test(S("aidjksrolc"), SV("imqnaghkfrdtlopbjesc"), 0, S::npos); + test(S("qpghtfbaji"), SV(""), 1, 1); + test(S("gfshlcmdjr"), SV("nadkh"), 1, 1); + test(S("nkodajteqp"), SV("ofdrqmkebl"), 1, 4); + test(S("gbmetiprqd"), SV("bdfjqgatlksriohemnpc"), 1, S::npos); + test(S("crnklpmegd"), SV(""), 5, 5); + test(S("jsbtafedoc"), SV("prqgn"), 5, 5); + test(S("qnmodrtkeb"), SV("pejafmnokr"), 5, 6); + test(S("cpebqsfmnj"), SV("odnqkgijrhabfmcestlp"), 5, S::npos); + test(S("lmofqdhpki"), SV(""), 9, 9); + test(S("hnefkqimca"), SV("rtjpa"), 9, S::npos); + test(S("drtasbgmfp"), SV("ktsrmnqagd"), 9, 9); + test(S("lsaijeqhtr"), SV("rtdhgcisbnmoaqkfpjle"), 9, S::npos); + test(S("elgofjmbrq"), SV(""), 10, S::npos); + test(S("mjqdgalkpc"), SV("dplqa"), 10, S::npos); + test(S("kthqnfcerm"), SV("dkacjoptns"), 10, S::npos); + test(S("dfsjhanorc"), SV("hqfimtrgnbekpdcsjalo"), 10, S::npos); + test(S("eqsgalomhb"), SV(""), 11, S::npos); + test(S("akiteljmoh"), SV("lofbc"), 11, S::npos); + test(S("hlbdfreqjo"), SV("astoegbfpn"), 11, S::npos); + test(S("taqobhlerg"), SV("pdgreqomsncafklhtibj"), 11, S::npos); + test(S("snafbdlghrjkpqtoceim"), SV(""), 0, 0); + test(S("aemtbrgcklhndjisfpoq"), SV("lbtqd"), 0, 0); + test(S("pnracgfkjdiholtbqsem"), SV("tboimldpjh"), 0, 1); + test(S("dicfltehbsgrmojnpkaq"), SV("slcerthdaiqjfnobgkpm"), 0, S::npos); + test(S("jlnkraeodhcspfgbqitm"), SV(""), 1, 1); + test(S("lhosrngtmfjikbqpcade"), SV("aqibs"), 1, 1); + test(S("rbtaqjhgkneisldpmfoc"), SV("gtfblmqinc"), 1, 3); + test(S("gpifsqlrdkbonjtmheca"), SV("mkqpbtdalgniorhfescj"), 1, S::npos); + test(S("hdpkobnsalmcfijregtq"), SV(""), 10, 10); + test(S("jtlshdgqaiprkbcoenfm"), SV("pblas"), 10, 11); + test(S("fkdrbqltsgmcoiphneaj"), SV("arosdhcfme"), 10, 13); + test(S("crsplifgtqedjohnabmk"), SV("blkhjeogicatqfnpdmsr"), 10, S::npos); + test(S("niptglfbosehkamrdqcj"), SV(""), 19, 19); + test(S("copqdhstbingamjfkler"), SV("djkqc"), 19, 19); + test(S("mrtaefilpdsgocnhqbjk"), SV("lgokshjtpb"), 19, S::npos); + test(S("kojatdhlcmigpbfrqnes"), SV("bqjhtkfepimcnsgrlado"), 19, S::npos); + test(S("eaintpchlqsbdgrkjofm"), SV(""), 20, S::npos); + test(S("gjnhidfsepkrtaqbmclo"), SV("nocfa"), 20, S::npos); + test(S("spocfaktqdbiejlhngmr"), SV("bgtajmiedc"), 20, S::npos); + test(S("rphmlekgfscndtaobiqj"), SV("lsckfnqgdahejiopbtmr"), 20, S::npos); + test(S("liatsqdoegkmfcnbhrpj"), SV(""), 21, S::npos); + test(S("binjagtfldkrspcomqeh"), SV("gfsrt"), 21, S::npos); + test(S("latkmisecnorjbfhqpdg"), SV("pfsocbhjtm"), 21, S::npos); + test(S("lecfratdjkhnsmqpoigb"), SV("tpflmdnoicjgkberhqsa"), 21, S::npos); +} + +template +void test1() +{ + test(S(""), SV(""), S::npos); + test(S(""), SV("laenf"), S::npos); + test(S(""), SV("pqlnkmbdjo"), S::npos); + test(S(""), SV("qkamfogpnljdcshbreti"), S::npos); + test(S("nhmko"), SV(""), 0); + test(S("lahfb"), SV("irkhs"), 0); + test(S("gmfhd"), SV("kantesmpgj"), 2); + test(S("odaft"), SV("oknlrstdpiqmjbaghcfe"), S::npos); + test(S("eolhfgpjqk"), SV(""), 0); + test(S("nbatdlmekr"), SV("bnrpe"), 2); + test(S("jdmciepkaq"), SV("jtdaefblso"), 2); + test(S("hkbgspoflt"), SV("oselktgbcapndfjihrmq"), S::npos); + test(S("gprdcokbnjhlsfmtieqa"), SV(""), 0); + test(S("qjghlnftcaismkropdeb"), SV("bjaht"), 0); + test(S("pnalfrdtkqcmojiesbhg"), SV("hjlcmgpket"), 1); + test(S("pniotcfrhqsmgdkjbael"), SV("htaobedqikfplcgjsmrn"), S::npos); +} + +int main() +{ + { + typedef std::string S; + typedef std::string_view SV; + test0(); + test1(); + } +#if TEST_STD_VER >= 11 + { + typedef std::basic_string, min_allocator> S; + typedef std::string_view SV; + test0(); + test1(); + } +#endif +} diff --git a/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp new file mode 100644 index 000000000000..05925afaa6cd --- /dev/null +++ b/test/std/strings/basic.string/string.ops/string_find.first.of/string_view_size.pass.cpp @@ -0,0 +1,159 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// size_type find_first_of(const basic_string_view sv, size_type pos = 0) const; + +#include +#include + +#include "min_allocator.h" + +template +void +test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x) +{ + assert(s.find_first_of(sv, pos) == x); + if (x != S::npos) + assert(pos <= x && x < s.size()); +} + +template +void +test(const S& s, SV sv, typename S::size_type x) +{ + assert(s.find_first_of(sv) == x); + if (x != S::npos) + assert(x < s.size()); +} + +template +void test0() +{ + test(S(""), SV(""), 0, S::npos); + test(S(""), SV("laenf"), 0, S::npos); + test(S(""), SV("pqlnkmbdjo"), 0, S::npos); + test(S(""), SV("qkamfogpnljdcshbreti"), 0, S::npos); + test(S(""), SV(""), 1, S::npos); + test(S(""), SV("bjaht"), 1, S::npos); + test(S(""), SV("hjlcmgpket"), 1, S::npos); + test(S(""), SV("htaobedqikfplcgjsmrn"), 1, S::npos); + test(S("fodgq"), SV(""), 0, S::npos); + test(S("qanej"), SV("dfkap"), 0, 1); + test(S("clbao"), SV("ihqrfebgad"), 0, 2); + test(S("mekdn"), SV("ngtjfcalbseiqrphmkdo"), 0, 0); + test(S("srdfq"), SV(""), 1, S::npos); + test(S("oemth"), SV("ikcrq"), 1, S::npos); + test(S("cdaih"), SV("dmajblfhsg"), 1, 1); + test(S("qohtk"), SV("oqftjhdmkgsblacenirp"), 1, 1); + test(S("cshmd"), SV(""), 2, S::npos); + test(S("lhcdo"), SV("oebqi"), 2, 4); + test(S("qnsoh"), SV("kojhpmbsfe"), 2, 2); + test(S("pkrof"), SV("acbsjqogpltdkhinfrem"), 2, 2); + test(S("fmtsp"), SV(""), 4, S::npos); + test(S("khbpm"), SV("aobjd"), 4, S::npos); + test(S("pbsji"), SV("pcbahntsje"), 4, S::npos); + test(S("mprdj"), SV("fhepcrntkoagbmldqijs"), 4, 4); + test(S("eqmpa"), SV(""), 5, S::npos); + test(S("omigs"), SV("kocgb"), 5, S::npos); + test(S("onmje"), SV("fbslrjiqkm"), 5, S::npos); + test(S("oqmrj"), SV("jeidpcmalhfnqbgtrsko"), 5, S::npos); + test(S("schfa"), SV(""), 6, S::npos); + test(S("igdsc"), SV("qngpd"), 6, S::npos); + test(S("brqgo"), SV("rodhqklgmb"), 6, S::npos); + test(S("tnrph"), SV("thdjgafrlbkoiqcspmne"), 6, S::npos); + test(S("hcjitbfapl"), SV(""), 0, S::npos); + test(S("daiprenocl"), SV("ashjd"), 0, 0); + test(S("litpcfdghe"), SV("mgojkldsqh"), 0, 0); + test(S("aidjksrolc"), SV("imqnaghkfrdtlopbjesc"), 0, 0); + test(S("qpghtfbaji"), SV(""), 1, S::npos); + test(S("gfshlcmdjr"), SV("nadkh"), 1, 3); + test(S("nkodajteqp"), SV("ofdrqmkebl"), 1, 1); + test(S("gbmetiprqd"), SV("bdfjqgatlksriohemnpc"), 1, 1); + test(S("crnklpmegd"), SV(""), 5, S::npos); + test(S("jsbtafedoc"), SV("prqgn"), 5, S::npos); + test(S("qnmodrtkeb"), SV("pejafmnokr"), 5, 5); + test(S("cpebqsfmnj"), SV("odnqkgijrhabfmcestlp"), 5, 5); + test(S("lmofqdhpki"), SV(""), 9, S::npos); + test(S("hnefkqimca"), SV("rtjpa"), 9, 9); + test(S("drtasbgmfp"), SV("ktsrmnqagd"), 9, S::npos); + test(S("lsaijeqhtr"), SV("rtdhgcisbnmoaqkfpjle"), 9, 9); + test(S("elgofjmbrq"), SV(""), 10, S::npos); + test(S("mjqdgalkpc"), SV("dplqa"), 10, S::npos); + test(S("kthqnfcerm"), SV("dkacjoptns"), 10, S::npos); + test(S("dfsjhanorc"), SV("hqfimtrgnbekpdcsjalo"), 10, S::npos); + test(S("eqsgalomhb"), SV(""), 11, S::npos); + test(S("akiteljmoh"), SV("lofbc"), 11, S::npos); + test(S("hlbdfreqjo"), SV("astoegbfpn"), 11, S::npos); + test(S("taqobhlerg"), SV("pdgreqomsncafklhtibj"), 11, S::npos); + test(S("snafbdlghrjkpqtoceim"), SV(""), 0, S::npos); + test(S("aemtbrgcklhndjisfpoq"), SV("lbtqd"), 0, 3); + test(S("pnracgfkjdiholtbqsem"), SV("tboimldpjh"), 0, 0); + test(S("dicfltehbsgrmojnpkaq"), SV("slcerthdaiqjfnobgkpm"), 0, 0); + test(S("jlnkraeodhcspfgbqitm"), SV(""), 1, S::npos); + test(S("lhosrngtmfjikbqpcade"), SV("aqibs"), 1, 3); + test(S("rbtaqjhgkneisldpmfoc"), SV("gtfblmqinc"), 1, 1); + test(S("gpifsqlrdkbonjtmheca"), SV("mkqpbtdalgniorhfescj"), 1, 1); + test(S("hdpkobnsalmcfijregtq"), SV(""), 10, S::npos); + test(S("jtlshdgqaiprkbcoenfm"), SV("pblas"), 10, 10); + test(S("fkdrbqltsgmcoiphneaj"), SV("arosdhcfme"), 10, 10); + test(S("crsplifgtqedjohnabmk"), SV("blkhjeogicatqfnpdmsr"), 10, 10); + test(S("niptglfbosehkamrdqcj"), SV(""), 19, S::npos); + test(S("copqdhstbingamjfkler"), SV("djkqc"), 19, S::npos); + test(S("mrtaefilpdsgocnhqbjk"), SV("lgokshjtpb"), 19, 19); + test(S("kojatdhlcmigpbfrqnes"), SV("bqjhtkfepimcnsgrlado"), 19, 19); + test(S("eaintpchlqsbdgrkjofm"), SV(""), 20, S::npos); + test(S("gjnhidfsepkrtaqbmclo"), SV("nocfa"), 20, S::npos); + test(S("spocfaktqdbiejlhngmr"), SV("bgtajmiedc"), 20, S::npos); + test(S("rphmlekgfscndtaobiqj"), SV("lsckfnqgdahejiopbtmr"), 20, S::npos); + test(S("liatsqdoegkmfcnbhrpj"), SV(""), 21, S::npos); + test(S("binjagtfldkrspcomqeh"), SV("gfsrt"), 21, S::npos); + test(S("latkmisecnorjbfhqpdg"), SV("pfsocbhjtm"), 21, S::npos); + test(S("lecfratdjkhnsmqpoigb"), SV("tpflmdnoicjgkberhqsa"), 21, S::npos); +} + +template +void test1() +{ + test(S(""), SV(""), S::npos); + test(S(""), SV("laenf"), S::npos); + test(S(""), SV("pqlnkmbdjo"), S::npos); + test(S(""), SV("qkamfogpnljdcshbreti"), S::npos); + test(S("nhmko"), SV(""), S::npos); + test(S("lahfb"), SV("irkhs"), 2); + test(S("gmfhd"), SV("kantesmpgj"), 0); + test(S("odaft"), SV("oknlrstdpiqmjbaghcfe"), 0); + test(S("eolhfgpjqk"), SV(""), S::npos); + test(S("nbatdlmekr"), SV("bnrpe"), 0); + test(S("jdmciepkaq"), SV("jtdaefblso"), 0); + test(S("hkbgspoflt"), SV("oselktgbcapndfjihrmq"), 0); + test(S("gprdcokbnjhlsfmtieqa"), SV(""), S::npos); + test(S("qjghlnftcaismkropdeb"), SV("bjaht"), 1); + test(S("pnalfrdtkqcmojiesbhg"), SV("hjlcmgpket"), 0); + test(S("pniotcfrhqsmgdkjbael"), SV("htaobedqikfplcgjsmrn"), 0); +} + +int main() +{ + { + typedef std::string S; + typedef std::string_view SV; + test0(); + test1(); + } +#if TEST_STD_VER >= 11 + { + typedef std::basic_string, min_allocator> S; + typedef std::string_view SV; + test0(); + test1(); + } +#endif +} diff --git a/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp new file mode 100644 index 000000000000..59d216df09b4 --- /dev/null +++ b/test/std/strings/basic.string/string.ops/string_find.last.not.of/string_view_size.pass.cpp @@ -0,0 +1,159 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// size_type find_last_not_of(basic_string_view sv, size_type pos = npos) const; + +#include +#include + +#include "min_allocator.h" + +template +void +test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x) +{ + assert(s.find_last_not_of(sv, pos) == x); + if (x != S::npos) + assert(x <= pos && x < s.size()); +} + +template +void +test(const S& s, SV sv, typename S::size_type x) +{ + assert(s.find_last_not_of(sv) == x); + if (x != S::npos) + assert(x < s.size()); +} + +template +void test0() +{ + test(S(""), SV(""), 0, S::npos); + test(S(""), SV("laenf"), 0, S::npos); + test(S(""), SV("pqlnkmbdjo"), 0, S::npos); + test(S(""), SV("qkamfogpnljdcshbreti"), 0, S::npos); + test(S(""), SV(""), 1, S::npos); + test(S(""), SV("bjaht"), 1, S::npos); + test(S(""), SV("hjlcmgpket"), 1, S::npos); + test(S(""), SV("htaobedqikfplcgjsmrn"), 1, S::npos); + test(S("fodgq"), SV(""), 0, 0); + test(S("qanej"), SV("dfkap"), 0, 0); + test(S("clbao"), SV("ihqrfebgad"), 0, 0); + test(S("mekdn"), SV("ngtjfcalbseiqrphmkdo"), 0, S::npos); + test(S("srdfq"), SV(""), 1, 1); + test(S("oemth"), SV("ikcrq"), 1, 1); + test(S("cdaih"), SV("dmajblfhsg"), 1, 0); + test(S("qohtk"), SV("oqftjhdmkgsblacenirp"), 1, S::npos); + test(S("cshmd"), SV(""), 2, 2); + test(S("lhcdo"), SV("oebqi"), 2, 2); + test(S("qnsoh"), SV("kojhpmbsfe"), 2, 1); + test(S("pkrof"), SV("acbsjqogpltdkhinfrem"), 2, S::npos); + test(S("fmtsp"), SV(""), 4, 4); + test(S("khbpm"), SV("aobjd"), 4, 4); + test(S("pbsji"), SV("pcbahntsje"), 4, 4); + test(S("mprdj"), SV("fhepcrntkoagbmldqijs"), 4, S::npos); + test(S("eqmpa"), SV(""), 5, 4); + test(S("omigs"), SV("kocgb"), 5, 4); + test(S("onmje"), SV("fbslrjiqkm"), 5, 4); + test(S("oqmrj"), SV("jeidpcmalhfnqbgtrsko"), 5, S::npos); + test(S("schfa"), SV(""), 6, 4); + test(S("igdsc"), SV("qngpd"), 6, 4); + test(S("brqgo"), SV("rodhqklgmb"), 6, S::npos); + test(S("tnrph"), SV("thdjgafrlbkoiqcspmne"), 6, S::npos); + test(S("hcjitbfapl"), SV(""), 0, 0); + test(S("daiprenocl"), SV("ashjd"), 0, S::npos); + test(S("litpcfdghe"), SV("mgojkldsqh"), 0, S::npos); + test(S("aidjksrolc"), SV("imqnaghkfrdtlopbjesc"), 0, S::npos); + test(S("qpghtfbaji"), SV(""), 1, 1); + test(S("gfshlcmdjr"), SV("nadkh"), 1, 1); + test(S("nkodajteqp"), SV("ofdrqmkebl"), 1, 0); + test(S("gbmetiprqd"), SV("bdfjqgatlksriohemnpc"), 1, S::npos); + test(S("crnklpmegd"), SV(""), 5, 5); + test(S("jsbtafedoc"), SV("prqgn"), 5, 5); + test(S("qnmodrtkeb"), SV("pejafmnokr"), 5, 4); + test(S("cpebqsfmnj"), SV("odnqkgijrhabfmcestlp"), 5, S::npos); + test(S("lmofqdhpki"), SV(""), 9, 9); + test(S("hnefkqimca"), SV("rtjpa"), 9, 8); + test(S("drtasbgmfp"), SV("ktsrmnqagd"), 9, 9); + test(S("lsaijeqhtr"), SV("rtdhgcisbnmoaqkfpjle"), 9, S::npos); + test(S("elgofjmbrq"), SV(""), 10, 9); + test(S("mjqdgalkpc"), SV("dplqa"), 10, 9); + test(S("kthqnfcerm"), SV("dkacjoptns"), 10, 9); + test(S("dfsjhanorc"), SV("hqfimtrgnbekpdcsjalo"), 10, S::npos); + test(S("eqsgalomhb"), SV(""), 11, 9); + test(S("akiteljmoh"), SV("lofbc"), 11, 9); + test(S("hlbdfreqjo"), SV("astoegbfpn"), 11, 8); + test(S("taqobhlerg"), SV("pdgreqomsncafklhtibj"), 11, S::npos); + test(S("snafbdlghrjkpqtoceim"), SV(""), 0, 0); + test(S("aemtbrgcklhndjisfpoq"), SV("lbtqd"), 0, 0); + test(S("pnracgfkjdiholtbqsem"), SV("tboimldpjh"), 0, S::npos); + test(S("dicfltehbsgrmojnpkaq"), SV("slcerthdaiqjfnobgkpm"), 0, S::npos); + test(S("jlnkraeodhcspfgbqitm"), SV(""), 1, 1); + test(S("lhosrngtmfjikbqpcade"), SV("aqibs"), 1, 1); + test(S("rbtaqjhgkneisldpmfoc"), SV("gtfblmqinc"), 1, 0); + test(S("gpifsqlrdkbonjtmheca"), SV("mkqpbtdalgniorhfescj"), 1, S::npos); + test(S("hdpkobnsalmcfijregtq"), SV(""), 10, 10); + test(S("jtlshdgqaiprkbcoenfm"), SV("pblas"), 10, 9); + test(S("fkdrbqltsgmcoiphneaj"), SV("arosdhcfme"), 10, 9); + test(S("crsplifgtqedjohnabmk"), SV("blkhjeogicatqfnpdmsr"), 10, S::npos); + test(S("niptglfbosehkamrdqcj"), SV(""), 19, 19); + test(S("copqdhstbingamjfkler"), SV("djkqc"), 19, 19); + test(S("mrtaefilpdsgocnhqbjk"), SV("lgokshjtpb"), 19, 16); + test(S("kojatdhlcmigpbfrqnes"), SV("bqjhtkfepimcnsgrlado"), 19, S::npos); + test(S("eaintpchlqsbdgrkjofm"), SV(""), 20, 19); + test(S("gjnhidfsepkrtaqbmclo"), SV("nocfa"), 20, 18); + test(S("spocfaktqdbiejlhngmr"), SV("bgtajmiedc"), 20, 19); + test(S("rphmlekgfscndtaobiqj"), SV("lsckfnqgdahejiopbtmr"), 20, S::npos); + test(S("liatsqdoegkmfcnbhrpj"), SV(""), 21, 19); + test(S("binjagtfldkrspcomqeh"), SV("gfsrt"), 21, 19); + test(S("latkmisecnorjbfhqpdg"), SV("pfsocbhjtm"), 21, 19); + test(S("lecfratdjkhnsmqpoigb"), SV("tpflmdnoicjgkberhqsa"), 21, S::npos); +} + +template +void test1() +{ + test(S(""), SV(""), S::npos); + test(S(""), SV("laenf"), S::npos); + test(S(""), SV("pqlnkmbdjo"), S::npos); + test(S(""), SV("qkamfogpnljdcshbreti"), S::npos); + test(S("nhmko"), SV(""), 4); + test(S("lahfb"), SV("irkhs"), 4); + test(S("gmfhd"), SV("kantesmpgj"), 4); + test(S("odaft"), SV("oknlrstdpiqmjbaghcfe"), S::npos); + test(S("eolhfgpjqk"), SV(""), 9); + test(S("nbatdlmekr"), SV("bnrpe"), 8); + test(S("jdmciepkaq"), SV("jtdaefblso"), 9); + test(S("hkbgspoflt"), SV("oselktgbcapndfjihrmq"), S::npos); + test(S("gprdcokbnjhlsfmtieqa"), SV(""), 19); + test(S("qjghlnftcaismkropdeb"), SV("bjaht"), 18); + test(S("pnalfrdtkqcmojiesbhg"), SV("hjlcmgpket"), 17); + test(S("pniotcfrhqsmgdkjbael"), SV("htaobedqikfplcgjsmrn"), S::npos); +} + +int main() +{ + { + typedef std::string S; + typedef std::string_view SV; + test0(); + test1(); + } +#if TEST_STD_VER >= 11 + { + typedef std::basic_string, min_allocator> S; + typedef std::string_view SV; +// test0(); +// test1(); + } +#endif +} diff --git a/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp new file mode 100644 index 000000000000..fb8ca34417a3 --- /dev/null +++ b/test/std/strings/basic.string/string.ops/string_find.last.of/string_view_size.pass.cpp @@ -0,0 +1,159 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// size_type find_last_of(const basic_string_view sv, size_type pos = npos) const; + +#include +#include + +#include "min_allocator.h" + +template +void +test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x) +{ + assert(s.find_last_of(sv, pos) == x); + if (x != S::npos) + assert(x <= pos && x < s.size()); +} + +template +void +test(const S& s, SV sv, typename S::size_type x) +{ + assert(s.find_last_of(sv) == x); + if (x != S::npos) + assert(x < s.size()); +} + +template +void test0() +{ + test(S(""), SV(""), 0, S::npos); + test(S(""), SV("laenf"), 0, S::npos); + test(S(""), SV("pqlnkmbdjo"), 0, S::npos); + test(S(""), SV("qkamfogpnljdcshbreti"), 0, S::npos); + test(S(""), SV(""), 1, S::npos); + test(S(""), SV("bjaht"), 1, S::npos); + test(S(""), SV("hjlcmgpket"), 1, S::npos); + test(S(""), SV("htaobedqikfplcgjsmrn"), 1, S::npos); + test(S("fodgq"), SV(""), 0, S::npos); + test(S("qanej"), SV("dfkap"), 0, S::npos); + test(S("clbao"), SV("ihqrfebgad"), 0, S::npos); + test(S("mekdn"), SV("ngtjfcalbseiqrphmkdo"), 0, 0); + test(S("srdfq"), SV(""), 1, S::npos); + test(S("oemth"), SV("ikcrq"), 1, S::npos); + test(S("cdaih"), SV("dmajblfhsg"), 1, 1); + test(S("qohtk"), SV("oqftjhdmkgsblacenirp"), 1, 1); + test(S("cshmd"), SV(""), 2, S::npos); + test(S("lhcdo"), SV("oebqi"), 2, S::npos); + test(S("qnsoh"), SV("kojhpmbsfe"), 2, 2); + test(S("pkrof"), SV("acbsjqogpltdkhinfrem"), 2, 2); + test(S("fmtsp"), SV(""), 4, S::npos); + test(S("khbpm"), SV("aobjd"), 4, 2); + test(S("pbsji"), SV("pcbahntsje"), 4, 3); + test(S("mprdj"), SV("fhepcrntkoagbmldqijs"), 4, 4); + test(S("eqmpa"), SV(""), 5, S::npos); + test(S("omigs"), SV("kocgb"), 5, 3); + test(S("onmje"), SV("fbslrjiqkm"), 5, 3); + test(S("oqmrj"), SV("jeidpcmalhfnqbgtrsko"), 5, 4); + test(S("schfa"), SV(""), 6, S::npos); + test(S("igdsc"), SV("qngpd"), 6, 2); + test(S("brqgo"), SV("rodhqklgmb"), 6, 4); + test(S("tnrph"), SV("thdjgafrlbkoiqcspmne"), 6, 4); + test(S("hcjitbfapl"), SV(""), 0, S::npos); + test(S("daiprenocl"), SV("ashjd"), 0, 0); + test(S("litpcfdghe"), SV("mgojkldsqh"), 0, 0); + test(S("aidjksrolc"), SV("imqnaghkfrdtlopbjesc"), 0, 0); + test(S("qpghtfbaji"), SV(""), 1, S::npos); + test(S("gfshlcmdjr"), SV("nadkh"), 1, S::npos); + test(S("nkodajteqp"), SV("ofdrqmkebl"), 1, 1); + test(S("gbmetiprqd"), SV("bdfjqgatlksriohemnpc"), 1, 1); + test(S("crnklpmegd"), SV(""), 5, S::npos); + test(S("jsbtafedoc"), SV("prqgn"), 5, S::npos); + test(S("qnmodrtkeb"), SV("pejafmnokr"), 5, 5); + test(S("cpebqsfmnj"), SV("odnqkgijrhabfmcestlp"), 5, 5); + test(S("lmofqdhpki"), SV(""), 9, S::npos); + test(S("hnefkqimca"), SV("rtjpa"), 9, 9); + test(S("drtasbgmfp"), SV("ktsrmnqagd"), 9, 7); + test(S("lsaijeqhtr"), SV("rtdhgcisbnmoaqkfpjle"), 9, 9); + test(S("elgofjmbrq"), SV(""), 10, S::npos); + test(S("mjqdgalkpc"), SV("dplqa"), 10, 8); + test(S("kthqnfcerm"), SV("dkacjoptns"), 10, 6); + test(S("dfsjhanorc"), SV("hqfimtrgnbekpdcsjalo"), 10, 9); + test(S("eqsgalomhb"), SV(""), 11, S::npos); + test(S("akiteljmoh"), SV("lofbc"), 11, 8); + test(S("hlbdfreqjo"), SV("astoegbfpn"), 11, 9); + test(S("taqobhlerg"), SV("pdgreqomsncafklhtibj"), 11, 9); + test(S("snafbdlghrjkpqtoceim"), SV(""), 0, S::npos); + test(S("aemtbrgcklhndjisfpoq"), SV("lbtqd"), 0, S::npos); + test(S("pnracgfkjdiholtbqsem"), SV("tboimldpjh"), 0, 0); + test(S("dicfltehbsgrmojnpkaq"), SV("slcerthdaiqjfnobgkpm"), 0, 0); + test(S("jlnkraeodhcspfgbqitm"), SV(""), 1, S::npos); + test(S("lhosrngtmfjikbqpcade"), SV("aqibs"), 1, S::npos); + test(S("rbtaqjhgkneisldpmfoc"), SV("gtfblmqinc"), 1, 1); + test(S("gpifsqlrdkbonjtmheca"), SV("mkqpbtdalgniorhfescj"), 1, 1); + test(S("hdpkobnsalmcfijregtq"), SV(""), 10, S::npos); + test(S("jtlshdgqaiprkbcoenfm"), SV("pblas"), 10, 10); + test(S("fkdrbqltsgmcoiphneaj"), SV("arosdhcfme"), 10, 10); + test(S("crsplifgtqedjohnabmk"), SV("blkhjeogicatqfnpdmsr"), 10, 10); + test(S("niptglfbosehkamrdqcj"), SV(""), 19, S::npos); + test(S("copqdhstbingamjfkler"), SV("djkqc"), 19, 16); + test(S("mrtaefilpdsgocnhqbjk"), SV("lgokshjtpb"), 19, 19); + test(S("kojatdhlcmigpbfrqnes"), SV("bqjhtkfepimcnsgrlado"), 19, 19); + test(S("eaintpchlqsbdgrkjofm"), SV(""), 20, S::npos); + test(S("gjnhidfsepkrtaqbmclo"), SV("nocfa"), 20, 19); + test(S("spocfaktqdbiejlhngmr"), SV("bgtajmiedc"), 20, 18); + test(S("rphmlekgfscndtaobiqj"), SV("lsckfnqgdahejiopbtmr"), 20, 19); + test(S("liatsqdoegkmfcnbhrpj"), SV(""), 21, S::npos); + test(S("binjagtfldkrspcomqeh"), SV("gfsrt"), 21, 12); + test(S("latkmisecnorjbfhqpdg"), SV("pfsocbhjtm"), 21, 17); + test(S("lecfratdjkhnsmqpoigb"), SV("tpflmdnoicjgkberhqsa"), 21, 19); +} + +template +void test1() +{ + test(S(""), SV(""), S::npos); + test(S(""), SV("laenf"), S::npos); + test(S(""), SV("pqlnkmbdjo"), S::npos); + test(S(""), SV("qkamfogpnljdcshbreti"), S::npos); + test(S("nhmko"), SV(""), S::npos); + test(S("lahfb"), SV("irkhs"), 2); + test(S("gmfhd"), SV("kantesmpgj"), 1); + test(S("odaft"), SV("oknlrstdpiqmjbaghcfe"), 4); + test(S("eolhfgpjqk"), SV(""), S::npos); + test(S("nbatdlmekr"), SV("bnrpe"), 9); + test(S("jdmciepkaq"), SV("jtdaefblso"), 8); + test(S("hkbgspoflt"), SV("oselktgbcapndfjihrmq"), 9); + test(S("gprdcokbnjhlsfmtieqa"), SV(""), S::npos); + test(S("qjghlnftcaismkropdeb"), SV("bjaht"), 19); + test(S("pnalfrdtkqcmojiesbhg"), SV("hjlcmgpket"), 19); + test(S("pniotcfrhqsmgdkjbael"), SV("htaobedqikfplcgjsmrn"), 19); +} + +int main() +{ + { + typedef std::string S; + typedef std::string_view SV; + test0(); + test1(); + } +#if TEST_STD_VER >= 11 + { + typedef std::basic_string, min_allocator> S; + typedef std::string_view SV; + test0(); + test1(); + } +#endif +} diff --git a/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp new file mode 100644 index 000000000000..096f47e2a991 --- /dev/null +++ b/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp @@ -0,0 +1,159 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// size_type find(basic_string_view sv, size_type pos = 0) const; + +#include +#include + +#include "min_allocator.h" + +template +void +test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x) +{ + assert(s.find(sv, pos) == x); + if (x != S::npos) + assert(pos <= x && x + sv.size() <= s.size()); +} + +template +void +test(const S& s, SV sv, typename S::size_type x) +{ + assert(s.find(sv) == x); + if (x != S::npos) + assert(0 <= x && x + sv.size() <= s.size()); +} + +template +void test0() +{ + test(S(""), SV(""), 0, 0); + test(S(""), SV("abcde"), 0, S::npos); + test(S(""), SV("abcdeabcde"), 0, S::npos); + test(S(""), SV("abcdeabcdeabcdeabcde"), 0, S::npos); + test(S(""), SV(""), 1, S::npos); + test(S(""), SV("abcde"), 1, S::npos); + test(S(""), SV("abcdeabcde"), 1, S::npos); + test(S(""), SV("abcdeabcdeabcdeabcde"), 1, S::npos); + test(S("abcde"), SV(""), 0, 0); + test(S("abcde"), SV("abcde"), 0, 0); + test(S("abcde"), SV("abcdeabcde"), 0, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 0, S::npos); + test(S("abcde"), SV(""), 1, 1); + test(S("abcde"), SV("abcde"), 1, S::npos); + test(S("abcde"), SV("abcdeabcde"), 1, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 1, S::npos); + test(S("abcde"), SV(""), 2, 2); + test(S("abcde"), SV("abcde"), 2, S::npos); + test(S("abcde"), SV("abcdeabcde"), 2, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 2, S::npos); + test(S("abcde"), SV(""), 4, 4); + test(S("abcde"), SV("abcde"), 4, S::npos); + test(S("abcde"), SV("abcdeabcde"), 4, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 4, S::npos); + test(S("abcde"), SV(""), 5, 5); + test(S("abcde"), SV("abcde"), 5, S::npos); + test(S("abcde"), SV("abcdeabcde"), 5, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 5, S::npos); + test(S("abcde"), SV(""), 6, S::npos); + test(S("abcde"), SV("abcde"), 6, S::npos); + test(S("abcde"), SV("abcdeabcde"), 6, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 6, S::npos); + test(S("abcdeabcde"), SV(""), 0, 0); + test(S("abcdeabcde"), SV("abcde"), 0, 0); + test(S("abcdeabcde"), SV("abcdeabcde"), 0, 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 0, S::npos); + test(S("abcdeabcde"), SV(""), 1, 1); + test(S("abcdeabcde"), SV("abcde"), 1, 5); + test(S("abcdeabcde"), SV("abcdeabcde"), 1, S::npos); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 1, S::npos); + test(S("abcdeabcde"), SV(""), 5, 5); + test(S("abcdeabcde"), SV("abcde"), 5, 5); + test(S("abcdeabcde"), SV("abcdeabcde"), 5, S::npos); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 5, S::npos); + test(S("abcdeabcde"), SV(""), 9, 9); + test(S("abcdeabcde"), SV("abcde"), 9, S::npos); + test(S("abcdeabcde"), SV("abcdeabcde"), 9, S::npos); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 9, S::npos); + test(S("abcdeabcde"), SV(""), 10, 10); + test(S("abcdeabcde"), SV("abcde"), 10, S::npos); + test(S("abcdeabcde"), SV("abcdeabcde"), 10, S::npos); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 10, S::npos); + test(S("abcdeabcde"), SV(""), 11, S::npos); + test(S("abcdeabcde"), SV("abcde"), 11, S::npos); + test(S("abcdeabcde"), SV("abcdeabcde"), 11, S::npos); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 11, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV(""), 0, 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 0, 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 0, 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 0, 0); + test(S("abcdeabcdeabcdeabcde"), SV(""), 1, 1); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 1, 5); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 1, 5); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 1, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV(""), 10, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 10, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 10, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 10, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV(""), 19, 19); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 19, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 19, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 19, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV(""), 20, 20); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 20, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 20, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 20, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV(""), 21, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 21, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 21, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 21, S::npos); +} + +template +void test1() +{ + test(S(""), SV(""), 0); + test(S(""), SV("abcde"), S::npos); + test(S(""), SV("abcdeabcde"), S::npos); + test(S(""), SV("abcdeabcdeabcdeabcde"), S::npos); + test(S("abcde"), SV(""), 0); + test(S("abcde"), SV("abcde"), 0); + test(S("abcde"), SV("abcdeabcde"), S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), S::npos); + test(S("abcdeabcde"), SV(""), 0); + test(S("abcdeabcde"), SV("abcde"), 0); + test(S("abcdeabcde"), SV("abcdeabcde"), 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), S::npos); + test(S("abcdeabcdeabcdeabcde"), SV(""), 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 0); +} + +int main() +{ + { + typedef std::string S; + typedef std::string_view SV; + test0(); + test1(); + } +#if TEST_STD_VER >= 11 + { + typedef std::basic_string, min_allocator> S; + typedef std::string_view SV; + test0(); + test1(); + } +#endif +} diff --git a/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp new file mode 100644 index 000000000000..230c4556cee6 --- /dev/null +++ b/test/std/strings/basic.string/string.ops/string_rfind/string_view_size.pass.cpp @@ -0,0 +1,159 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// size_type rfind(basic_string_view sv, size_type pos = npos) const; + +#include +#include + +#include "min_allocator.h" + +template +void +test(const S& s, SV sv, typename S::size_type pos, typename S::size_type x) +{ + assert(s.rfind(sv, pos) == x); + if (x != S::npos) + assert(x <= pos && x + sv.size() <= s.size()); +} + +template +void +test(const S& s, SV sv, typename S::size_type x) +{ + assert(s.rfind(sv) == x); + if (x != S::npos) + assert(0 <= x && x + sv.size() <= s.size()); +} + +template +void test0() +{ + test(S(""), SV(""), 0, 0); + test(S(""), SV("abcde"), 0, S::npos); + test(S(""), SV("abcdeabcde"), 0, S::npos); + test(S(""), SV("abcdeabcdeabcdeabcde"), 0, S::npos); + test(S(""), SV(""), 1, 0); + test(S(""), SV("abcde"), 1, S::npos); + test(S(""), SV("abcdeabcde"), 1, S::npos); + test(S(""), SV("abcdeabcdeabcdeabcde"), 1, S::npos); + test(S("abcde"), SV(""), 0, 0); + test(S("abcde"), SV("abcde"), 0, 0); + test(S("abcde"), SV("abcdeabcde"), 0, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 0, S::npos); + test(S("abcde"), SV(""), 1, 1); + test(S("abcde"), SV("abcde"), 1, 0); + test(S("abcde"), SV("abcdeabcde"), 1, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 1, S::npos); + test(S("abcde"), SV(""), 2, 2); + test(S("abcde"), SV("abcde"), 2, 0); + test(S("abcde"), SV("abcdeabcde"), 2, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 2, S::npos); + test(S("abcde"), SV(""), 4, 4); + test(S("abcde"), SV("abcde"), 4, 0); + test(S("abcde"), SV("abcdeabcde"), 4, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 4, S::npos); + test(S("abcde"), SV(""), 5, 5); + test(S("abcde"), SV("abcde"), 5, 0); + test(S("abcde"), SV("abcdeabcde"), 5, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 5, S::npos); + test(S("abcde"), SV(""), 6, 5); + test(S("abcde"), SV("abcde"), 6, 0); + test(S("abcde"), SV("abcdeabcde"), 6, S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), 6, S::npos); + test(S("abcdeabcde"), SV(""), 0, 0); + test(S("abcdeabcde"), SV("abcde"), 0, 0); + test(S("abcdeabcde"), SV("abcdeabcde"), 0, 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 0, S::npos); + test(S("abcdeabcde"), SV(""), 1, 1); + test(S("abcdeabcde"), SV("abcde"), 1, 0); + test(S("abcdeabcde"), SV("abcdeabcde"), 1, 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 1, S::npos); + test(S("abcdeabcde"), SV(""), 5, 5); + test(S("abcdeabcde"), SV("abcde"), 5, 5); + test(S("abcdeabcde"), SV("abcdeabcde"), 5, 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 5, S::npos); + test(S("abcdeabcde"), SV(""), 9, 9); + test(S("abcdeabcde"), SV("abcde"), 9, 5); + test(S("abcdeabcde"), SV("abcdeabcde"), 9, 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 9, S::npos); + test(S("abcdeabcde"), SV(""), 10, 10); + test(S("abcdeabcde"), SV("abcde"), 10, 5); + test(S("abcdeabcde"), SV("abcdeabcde"), 10, 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 10, S::npos); + test(S("abcdeabcde"), SV(""), 11, 10); + test(S("abcdeabcde"), SV("abcde"), 11, 5); + test(S("abcdeabcde"), SV("abcdeabcde"), 11, 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), 11, S::npos); + test(S("abcdeabcdeabcdeabcde"), SV(""), 0, 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 0, 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 0, 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 0, 0); + test(S("abcdeabcdeabcdeabcde"), SV(""), 1, 1); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 1, 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 1, 0); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 1, 0); + test(S("abcdeabcdeabcdeabcde"), SV(""), 10, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 10, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 10, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 10, 0); + test(S("abcdeabcdeabcdeabcde"), SV(""), 19, 19); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 19, 15); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 19, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 19, 0); + test(S("abcdeabcdeabcdeabcde"), SV(""), 20, 20); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 20, 15); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 20, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 20, 0); + test(S("abcdeabcdeabcdeabcde"), SV(""), 21, 20); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 21, 15); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 21, 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 21, 0); +} + +template +void test1() +{ + test(S(""), SV(""), 0); + test(S(""), SV("abcde"), S::npos); + test(S(""), SV("abcdeabcde"), S::npos); + test(S(""), SV("abcdeabcdeabcdeabcde"), S::npos); + test(S("abcde"), SV(""), 5); + test(S("abcde"), SV("abcde"), 0); + test(S("abcde"), SV("abcdeabcde"), S::npos); + test(S("abcde"), SV("abcdeabcdeabcdeabcde"), S::npos); + test(S("abcdeabcde"), SV(""), 10); + test(S("abcdeabcde"), SV("abcde"), 5); + test(S("abcdeabcde"), SV("abcdeabcde"), 0); + test(S("abcdeabcde"), SV("abcdeabcdeabcdeabcde"), S::npos); + test(S("abcdeabcdeabcdeabcde"), SV(""), 20); + test(S("abcdeabcdeabcdeabcde"), SV("abcde"), 15); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcde"), 10); + test(S("abcdeabcdeabcdeabcde"), SV("abcdeabcdeabcdeabcde"), 0); +} + +int main() +{ + { + typedef std::string S; + typedef std::string_view SV; + test0(); + test1(); + } +#if TEST_STD_VER >= 11 + { + typedef std::basic_string, min_allocator> S; + typedef std::string_view SV; + test0(); + test1(); + } +#endif +} diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp index c8f4178a26bd..75e2ecac3c41 100644 --- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp @@ -16,6 +16,7 @@ // Allow incomplete argument types in the __is_callable check #include +#include struct X{ typedef std::function callback_type; @@ -24,6 +25,40 @@ struct X{ callback_type _cb; }; -int main() -{ +struct IncompleteReturnType { + std::function fn; +}; + + +int called = 0; +IncompleteReturnType test_fn() { + ++called; + IncompleteReturnType I; + return I; +} + +// See llvm.org/PR34298 +void test_pr34298() +{ + static_assert(std::is_copy_constructible::value, ""); + static_assert(std::is_copy_assignable::value, ""); + { + IncompleteReturnType X; + X.fn = test_fn; + const IncompleteReturnType& CX = X; + IncompleteReturnType X2 = CX; + assert(X2.fn); + assert(called == 0); + X2.fn(); + assert(called == 1); + } + { + IncompleteReturnType Empty; + IncompleteReturnType X2 = Empty; + assert(!X2.fn); + } +} + +int main() { + test_pr34298(); } diff --git a/test/support/container_test_types.h b/test/support/container_test_types.h index 08e88f091461..b8422ec4602d 100644 --- a/test/support/container_test_types.h +++ b/test/support/container_test_types.h @@ -234,6 +234,19 @@ inline ConstructController* getConstructController() { return &c; } +template +struct ExpectConstructGuard { + ExpectConstructGuard(int N) { + auto CC = getConstructController(); + assert(!CC->unchecked()); + CC->expect(N); + } + + ~ExpectConstructGuard() { + assert(!getConstructController()->unchecked()); + } +}; + //===----------------------------------------------------------------------===// // ContainerTestAllocator //===----------------------------------------------------------------------===// @@ -417,7 +430,12 @@ namespace std { return arg.data; } }; - + template + class vector; + template + class deque; + template + class list; template class map; template @@ -444,6 +462,13 @@ _LIBCPP_END_NAMESPACE_STD // TCT - Test container type namespace TCT { +template > +using vector = std::vector >; +template > +using deque = std::deque >; +template > +using list = std::list >; + template , class Value = CopyInsertable<2>, class ValueTp = std::pair > using unordered_map = @@ -488,5 +513,4 @@ using multiset = } // end namespace TCT - #endif // SUPPORT_CONTAINER_TEST_TYPES_H diff --git a/test/support/emplace_constructible.h b/test/support/emplace_constructible.h new file mode 100644 index 000000000000..f2bc0ec6a367 --- /dev/null +++ b/test/support/emplace_constructible.h @@ -0,0 +1,74 @@ +#ifndef TEST_SUPPORT_EMPLACE_CONSTRUCTIBLE_H +#define TEST_SUPPORT_EMPLACE_CONSTRUCTIBLE_H + +#include "test_macros.h" + +#if TEST_STD_VER >= 11 +template +struct EmplaceConstructible { + T value; + explicit EmplaceConstructible(T value) : value(value) {} + EmplaceConstructible(EmplaceConstructible const&) = delete; +}; + +template +struct EmplaceConstructibleAndMoveInsertable { + int copied = 0; + T value; + explicit EmplaceConstructibleAndMoveInsertable(T value) : value(value) {} + + EmplaceConstructibleAndMoveInsertable( + EmplaceConstructibleAndMoveInsertable&& Other) + : copied(Other.copied + 1), value(std::move(Other.value)) {} +}; + +template +struct EmplaceConstructibleAndMoveable { + int copied = 0; + int assigned = 0; + T value; + explicit EmplaceConstructibleAndMoveable(T value) noexcept : value(value) {} + + EmplaceConstructibleAndMoveable(EmplaceConstructibleAndMoveable&& Other) + noexcept : copied(Other.copied + 1), + value(std::move(Other.value)) {} + + EmplaceConstructibleAndMoveable& + operator=(EmplaceConstructibleAndMoveable&& Other) noexcept { + copied = Other.copied; + assigned = Other.assigned + 1; + value = std::move(Other.value); + return *this; + } +}; + +template +struct EmplaceConstructibleMoveableAndAssignable { + int copied = 0; + int assigned = 0; + T value; + explicit EmplaceConstructibleMoveableAndAssignable(T value) noexcept + : value(value) {} + + EmplaceConstructibleMoveableAndAssignable( + EmplaceConstructibleMoveableAndAssignable&& Other) noexcept + : copied(Other.copied + 1), + value(std::move(Other.value)) {} + + EmplaceConstructibleMoveableAndAssignable& + operator=(EmplaceConstructibleMoveableAndAssignable&& Other) noexcept { + copied = Other.copied; + assigned = Other.assigned + 1; + value = std::move(Other.value); + return *this; + } + + EmplaceConstructibleMoveableAndAssignable& operator=(T xvalue) { + value = std::move(xvalue); + ++assigned; + return *this; + } +}; +#endif + +#endif // TEST_SUPPORT_EMPLACE_CONSTRUCTIBLE_H From d040441f934c022d291dd78321d95ff2bff27f05 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 2 Dec 2017 12:47:20 +0000 Subject: [PATCH 4/5] Vendor import of lld release_50 branch r319231: https://llvm.org/svn/llvm-project/lld/branches/release_50@319231 --- ELF/SyntheticSections.cpp | 12 +++-- ELF/SyntheticSections.h | 3 +- test/ELF/eh-frame-padding-no-rosegment.s | 64 ++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 test/ELF/eh-frame-padding-no-rosegment.s diff --git a/ELF/SyntheticSections.cpp b/ELF/SyntheticSections.cpp index 4bbec4ab34bd..a67b039ddf21 100644 --- a/ELF/SyntheticSections.cpp +++ b/ELF/SyntheticSections.cpp @@ -427,10 +427,11 @@ CieRecord *EhFrameSection::addCie(EhSectionPiece &Piece, &Sec->template getFile()->getRelocTargetSym(Rels[FirstRelI]); // Search for an existing CIE by CIE contents/relocation target pair. - CieRecord *Cie = &CieMap[{Piece.data(), Personality}]; + CieRecord *&Cie = CieMap[{Piece.data(), Personality}]; // If not found, create a new one. - if (Cie->Piece == nullptr) { + if (!Cie) { + Cie = make(); Cie->Piece = &Piece; Cies.push_back(Cie); } @@ -522,9 +523,14 @@ template static void writeCieFde(uint8_t *Buf, ArrayRef D) { memcpy(Buf, D.data(), D.size()); + size_t Aligned = alignTo(D.size(), sizeof(typename ELFT::uint)); + + // Zero-clear trailing padding if it exists. + memset(Buf + D.size(), 0, Aligned - D.size()); + // Fix the size field. -4 since size does not include the size field itself. const endianness E = ELFT::TargetEndianness; - write32(Buf, alignTo(D.size(), sizeof(typename ELFT::uint)) - 4); + write32(Buf, Aligned - 4); } template void EhFrameSection::finalizeContents() { diff --git a/ELF/SyntheticSections.h b/ELF/SyntheticSections.h index ddd8ca99a61b..ccf021ec9597 100644 --- a/ELF/SyntheticSections.h +++ b/ELF/SyntheticSections.h @@ -103,7 +103,8 @@ template class EhFrameSection final : public SyntheticSection { std::vector Cies; // CIE records are uniquified by their contents and personality functions. - llvm::DenseMap, SymbolBody *>, CieRecord> CieMap; + llvm::DenseMap, SymbolBody *>, CieRecord *> + CieMap; }; class GotSection : public SyntheticSection { diff --git a/test/ELF/eh-frame-padding-no-rosegment.s b/test/ELF/eh-frame-padding-no-rosegment.s new file mode 100644 index 000000000000..951fed0a56e9 --- /dev/null +++ b/test/ELF/eh-frame-padding-no-rosegment.s @@ -0,0 +1,64 @@ +// REQUIRES: x86 + +.cfi_startproc +.cfi_personality 0x1b, bar +.cfi_endproc + +.global bar +.hidden bar +bar: + +// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o + +// Check the size of the CIE (0x18 + 4) and FDE (0x10 + 4) +// RUN: llvm-readobj -s -section-data %t.o | FileCheck --check-prefix=OBJ %s + +// OBJ: Name: .eh_frame +// OBJ-NEXT: Type: +// OBJ-NEXT: Flags [ +// OBJ-NEXT: SHF_ALLOC +// OBJ-NEXT: ] +// OBJ-NEXT: Address: +// OBJ-NEXT: Offset: +// OBJ-NEXT: Size: +// OBJ-NEXT: Link: +// OBJ-NEXT: Info: +// OBJ-NEXT: AddressAlignment: +// OBJ-NEXT: EntrySize: +// OBJ-NEXT: SectionData ( +// OBJ-NEXT: 0000: 18000000 00000000 017A5052 00017810 +// OBJ-NEXT: 0010: 061B0000 00001B0C 07089001 10000000 +// OBJ-NEXT: 0020: 20000000 00000000 00000000 00000000 +// OBJ-NEXT: ) + +// RUN: ld.lld %t.o -no-rosegment -o %t -shared + +// Check that .eh_frame is in the same segment as .text +// RUN: llvm-readobj -l --elf-output-style=GNU %t | FileCheck --check-prefix=PHDR %s + +// PHDR: Segment Sections +// PHDR: .text +// PHDR-SAME: .eh_frame + +// Check that the CIE and FDE are padded with 0x00 and not 0xCC when the +// .eh_frame section is placed in the executable segment +// RUN: llvm-readobj -s -section-data %t | FileCheck %s + +// CHECK: Name: .eh_frame +// CHECK-NEXT: Type: +// CHECK-NEXT: Flags +// CHECK-NEXT: SHF_ALLOC +// CHECK-NEXT: ] +// CHECK-NEXT: Address: +// CHECK-NEXT: Offset: +// CHECK-NEXT: Size: +// CHECK-NEXT: Link: +// CHECK-NEXT: Info: +// CHECK-NEXT: AddressAlignment: +// CHECK-NEXT: EntrySize: +// CHECK-NEXT: SectionData ( +// CHECK-NEXT: 0000: 1C000000 00000000 017A5052 00017810 +// CHECK-NEXT: 0010: 061BBEFF FFFF1B0C 07089001 00000000 +// CHECK-NEXT: 0020: 14000000 24000000 A8FFFFFF 00000000 +// CHECK-NEXT: 0030: 00000000 00000000 +// CHECK-NEXT: ) From 76e0736e7fcfeb179779e49c05604464b1ccd704 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 2 Dec 2017 12:47:31 +0000 Subject: [PATCH 5/5] Vendor import of lldb release_50 branch r319231: https://llvm.org/svn/llvm-project/lldb/branches/release_50@319231 --- source/Expression/IRExecutionUnit.cpp | 3 +-- unittests/tools/lldb-server/tests/MessageObjects.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/Expression/IRExecutionUnit.cpp b/source/Expression/IRExecutionUnit.cpp index e31483f1728d..363e6fe8678f 100644 --- a/source/Expression/IRExecutionUnit.cpp +++ b/source/Expression/IRExecutionUnit.cpp @@ -282,8 +282,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr, .setMCJITMemoryManager( std::unique_ptr(new MemoryManager(*this))) .setCodeModel(codeModel) - .setOptLevel(llvm::CodeGenOpt::Less) - .setUseOrcMCJITReplacement(true); + .setOptLevel(llvm::CodeGenOpt::Less); llvm::StringRef mArch; llvm::StringRef mCPU; diff --git a/unittests/tools/lldb-server/tests/MessageObjects.cpp b/unittests/tools/lldb-server/tests/MessageObjects.cpp index 9fcb4207675a..6ac067bce062 100644 --- a/unittests/tools/lldb-server/tests/MessageObjects.cpp +++ b/unittests/tools/lldb-server/tests/MessageObjects.cpp @@ -67,8 +67,8 @@ StringRef ThreadInfo::ReadRegister(unsigned int register_id) const { bool ThreadInfo::ReadRegisterAsUint64(unsigned int register_id, uint64_t &value) const { - StringRef value_str(m_registers.lookup(register_id)); - if (value_str.getAsInteger(16, value)) { + std::string value_str(m_registers.lookup(register_id)); + if (!llvm::to_integer(value_str, value, 16)) { GTEST_LOG_(ERROR) << formatv("ThreadInfo: Unable to parse register value at {0}.", register_id)