diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def --- a/clang/include/clang/Basic/CodeGenOptions.def +++ b/clang/include/clang/Basic/CodeGenOptions.def @@ -114,6 +114,9 @@ CODEGENOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame is ///< enabled. +CODEGENOPT(ForceDwarfUnwindInfo , 1, 0) ///< Set when -fforce-dwarf-unwind-info + ///< is enabled. + ///< Set when -fxray-always-emit-customevents is enabled. CODEGENOPT(XRayAlwaysEmitCustomEvents , 1, 0) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3005,6 +3005,9 @@ defm force_dwarf_frame : BoolFOption<"force-dwarf-frame", CodeGenOpts<"ForceDwarfFrameSection">, DefaultFalse, PosFlag, NegFlag>; +defm force_dwarf_unwind_info : BoolFOption<"force-dwarf-unwind-info", + CodeGenOpts<"ForceDwarfUnwindInfo">, DefaultFalse, + PosFlag, NegFlag>; def g_Flag : Flag<["-"], "g">, Group, HelpText<"Generate source-level debug information">; def gline_tables_only : Flag<["-"], "gline-tables-only">, Group, diff --git a/lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s b/lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s --- a/lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s +++ b/lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s @@ -28,18 +28,17 @@ # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --bind %t/a.out | FileCheck %s --check-prefixes=A,CHECK -D#%x,OFF=0x100000000 # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --bind %t/b.out | FileCheck %s --check-prefixes=BC,CHECK -D#%x,OFF=0x100000000 -# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --bind %t/c.out | FileCheck %s --check-prefixes=BC,C,CHECK -D#%x,OFF=0 +# RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --bind %t/c.out | FileCheck %s --check-prefixes=BC,CHECK -D#%x,OFF=0 # A: Indirect symbols for (__DATA_CONST,__got) -# A-NEXT: address index name -# A: 0x[[#%x,GXX_PERSONALITY_LO:]] [[#]] ___gxx_personality_v0 -# A: 0x[[#%x,GXX_PERSONALITY_HI:]] [[#]] ___gxx_personality_v0 -# A: 0x[[#%x,PERSONALITY_1:]] LOCAL -# A: 0x[[#%x,PERSONALITY_2:]] LOCAL +# A-NEXT: address index name +# A-DAG: 0x[[#%x,GXX_PERSONALITY_LO:]] 9 ___gxx_personality_v0 +# A-DAG: 0x[[#%x,GXX_PERSONALITY_HI:]] 2 ___gxx_personality_v0 +# A-DAG: 0x[[#%x,PERSONALITY_1:]] LOCAL +# A-DAG: 0x[[#%x,PERSONALITY_2:]] LOCAL # BC: Indirect symbols for (__DATA_CONST,__got) # BC-NEXT: address index name -# C: 0x[[#%x,GXX_PERSONALITY_HI:]] LOCAL # BC: 0x[[#%x,GXX_PERSONALITY_LO:]] LOCAL # BC: 0x[[#%x,PERSONALITY_1:]] LOCAL # BC: 0x[[#%x,PERSONALITY_2:]] LOCAL @@ -51,7 +50,7 @@ # A: Bind table # A-NEXT: segment section address type addend dylib symbol -# A-NEXT: __DATA_CONST __got 0x[[#GXX_PERSONALITY_LO-0]] pointer 0 libc++abi ___gxx_personality_v0 +# A-NEXT: __DATA_CONST __got 0x[[#GXX_PERSONALITY_LO]] pointer 0 libc++abi ___gxx_personality_v0 ## Error cases. ## Check that dylib symbols are picked (which means without libc++, we'd get an undefined symbol error. diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h --- a/llvm/include/llvm/MC/MCContext.h +++ b/llvm/include/llvm/MC/MCContext.h @@ -771,6 +771,7 @@ bool getGenDwarfForAssembly() { return GenDwarfForAssembly; } void setGenDwarfForAssembly(bool Value) { GenDwarfForAssembly = Value; } unsigned getGenDwarfFileNumber() { return GenDwarfFileNumber; } + bool forceDwarfUnwindInfo() const; void setGenDwarfFileNumber(unsigned FileNumber) { GenDwarfFileNumber = FileNumber; diff --git a/llvm/include/llvm/MC/MCTargetOptions.h b/llvm/include/llvm/MC/MCTargetOptions.h --- a/llvm/include/llvm/MC/MCTargetOptions.h +++ b/llvm/include/llvm/MC/MCTargetOptions.h @@ -57,6 +57,7 @@ bool PreserveAsmComments : 1; bool Dwarf64 : 1; + bool ForceDwarfUnwindInfo : 1; int DwarfVersion = 0; std::string ABIName; diff --git a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h --- a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h +++ b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h @@ -32,6 +32,8 @@ bool getDwarf64(); +bool getForceDwarfUnwindInfo(); + bool getShowMCInst(); bool getFatalWarnings(); diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h --- a/llvm/include/llvm/Target/TargetOptions.h +++ b/llvm/include/llvm/Target/TargetOptions.h @@ -142,8 +142,9 @@ EmitAddrsig(false), EmitCallSiteInfo(false), SupportsDebugEntryValues(false), EnableDebugEntryValues(false), ValueTrackingVariableLocations(false), ForceDwarfFrameSection(false), - XRayOmitFunctionIndex(false), DebugStrictDwarf(false), - Hotpatch(false), PPCGenScalarMASSEntries(false), JMCInstrument(false), + ForceDwarfUnwindInfo(false), XRayOmitFunctionIndex(false), + DebugStrictDwarf(false), Hotpatch(false), + PPCGenScalarMASSEntries(false), JMCInstrument(false), EnableCFIFixup(false), MisExpect(false), FPDenormalMode(DenormalMode::IEEE, DenormalMode::IEEE) {} @@ -341,6 +342,9 @@ /// Emit DWARF debug frame section. unsigned ForceDwarfFrameSection : 1; + /// Emit DWARF unwind info (EH frames) for all functions. + unsigned ForceDwarfUnwindInfo : 1; + /// Emit XRay Function Index section unsigned XRayOmitFunctionIndex : 1; diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -251,6 +251,9 @@ "Cannot emit MC with limited codegen pipeline"); Ctx = &MMIWP->getMMI().getContext(); + // libunwind is unable to load compact unwind dynamically, so we must generate + // DWARF unwind info for the JIT. + Options.MCOptions.ForceDwarfUnwindInfo = true; if (Options.MCOptions.MCSaveTempLabels) Ctx->setAllowTemporaryLabels(false); diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -66,7 +66,7 @@ : TM(std::move(MMI.TM)), Context(MMI.TM.getTargetTriple(), MMI.TM.getMCAsmInfo(), MMI.TM.getMCRegisterInfo(), MMI.TM.getMCSubtargetInfo(), nullptr, - nullptr, false), + &MMI.TM.Options.MCOptions, false), MachineFunctions(std::move(MMI.MachineFunctions)) { Context.setObjectFileInfo(MMI.TM.getObjFileLowering()); ObjFileMMI = MMI.ObjFileMMI; @@ -78,7 +78,7 @@ MachineModuleInfo::MachineModuleInfo(const LLVMTargetMachine *TM) : TM(*TM), Context(TM->getTargetTriple(), TM->getMCAsmInfo(), TM->getMCRegisterInfo(), TM->getMCSubtargetInfo(), - nullptr, nullptr, false) { + nullptr, &TM->Options.MCOptions, false) { Context.setObjectFileInfo(TM->getObjFileLowering()); initialize(); } @@ -87,7 +87,7 @@ MCContext *ExtContext) : TM(*TM), Context(TM->getTargetTriple(), TM->getMCAsmInfo(), TM->getMCRegisterInfo(), TM->getMCSubtargetInfo(), - nullptr, nullptr, false), + nullptr, &TM->Options.MCOptions, false), ExternalContext(ExtContext) { Context.setObjectFileInfo(TM->getObjFileLowering()); initialize(); diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp --- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -19,6 +19,7 @@ #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Mangler.h" #include "llvm/IR/Module.h" +#include "llvm/MC/MCContext.h" #include "llvm/Object/Archive.h" #include "llvm/Object/ObjectFile.h" #include "llvm/Support/DynamicLibrary.h" diff --git a/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp b/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp --- a/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp @@ -12,6 +12,7 @@ #include "llvm/ExecutionEngine/ObjectCache.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Module.h" +#include "llvm/MC/MCContext.h" #include "llvm/Object/ObjectFile.h" #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp @@ -95,18 +95,16 @@ // and projects/libunwind/src/UnwindLevel1-gcc-ext.c. const char *P = (const char *)Addr; const char *End = P + Size; - do { + while (P != End) P = processFDE(P, false); - } while(P != End); } void RTDyldMemoryManager::deregisterEHFramesInProcess(uint8_t *Addr, size_t Size) { const char *P = (const char *)Addr; const char *End = P + Size; - do { + while (P != End) P = processFDE(P, true); - } while(P != End); } #else diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -874,6 +874,10 @@ // Dwarf Management //===----------------------------------------------------------------------===// +bool MCContext::forceDwarfUnwindInfo() const { + return TargetOptions && TargetOptions->ForceDwarfUnwindInfo; +} + void MCContext::setGenDwarfRootFile(StringRef InputFileName, StringRef Buffer) { // MCDwarf needs the root file as well as the compilation directory. // If we find a '.file 0' directive that will supersede these values. diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -1840,8 +1840,6 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB, bool IsEH) { - Streamer.generateCompactUnwindEncodings(MAB); - MCContext &Context = Streamer.getContext(); const MCObjectFileInfo *MOFI = Context.getObjectFileInfo(); const MCAsmInfo *AsmInfo = Context.getAsmInfo(); @@ -1851,6 +1849,7 @@ // Emit the compact unwind info if available. bool NeedsEHFrameSection = !MOFI->getSupportsCompactUnwindWithoutEHFrame(); if (IsEH && MOFI->getCompactUnwindSection()) { + Streamer.generateCompactUnwindEncodings(MAB); bool SectionEmitted = false; for (const MCDwarfFrameInfo &Frame : FrameArray) { if (Frame.CompactUnwindEncoding == 0) continue; diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -64,8 +64,7 @@ (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32)) SupportsCompactUnwindWithoutEHFrame = true; - if (T.isWatchABI()) - OmitDwarfIfHaveCompactUnwind = true; + OmitDwarfIfHaveCompactUnwind = !Ctx->forceDwarfUnwindInfo(); FDECFIEncoding = dwarf::DW_EH_PE_pcrel; diff --git a/llvm/lib/MC/MCTargetOptionsCommandFlags.cpp b/llvm/lib/MC/MCTargetOptionsCommandFlags.cpp --- a/llvm/lib/MC/MCTargetOptionsCommandFlags.cpp +++ b/llvm/lib/MC/MCTargetOptionsCommandFlags.cpp @@ -39,6 +39,7 @@ MCOPT(bool, IncrementalLinkerCompatible) MCOPT(int, DwarfVersion) MCOPT(bool, Dwarf64) +MCOPT(bool, ForceDwarfUnwindInfo) MCOPT(bool, ShowMCInst) MCOPT(bool, FatalWarnings) MCOPT(bool, NoWarn) @@ -73,6 +74,11 @@ cl::desc("Generate debugging info in the 64-bit DWARF format")); MCBINDOPT(Dwarf64); + static cl::opt ForceDwarfUnwindInfo( + "force-dwarf-unwind-info", + cl::desc("Always emit a DWARF EH frame section."), cl::init(false)); + MCBINDOPT(ForceDwarfUnwindInfo); + static cl::opt ShowMCInst( "asm-show-inst", cl::desc("Emit internal instruction representation to assembly file")); @@ -110,6 +116,7 @@ Options.MCIncrementalLinkerCompatible = getIncrementalLinkerCompatible(); Options.Dwarf64 = getDwarf64(); Options.DwarfVersion = getDwarfVersion(); + Options.ForceDwarfUnwindInfo = getForceDwarfUnwindInfo(); Options.ShowMCInst = getShowMCInst(); Options.ABIName = getABIName(); Options.MCFatalWarnings = getFatalWarnings(); diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp --- a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp @@ -1377,7 +1377,7 @@ default: // Any other CFI directives indicate a frame that we aren't prepared // to represent via compact unwind, so just bail out. - return 0; + return CU::UNWIND_MODE_DWARF; case MCCFIInstruction::OpDefCfaRegister: { // Defines a frame pointer. E.g. // @@ -1391,7 +1391,7 @@ // generate a compact unwinding representation, so bail out. if (*MRI.getLLVMRegNum(Inst.getRegister(), true) != (Is64Bit ? X86::RBP : X86::EBP)) - return 0; + return CU::UNWIND_MODE_DWARF; // Reset the counts. memset(SavedRegs, 0, sizeof(SavedRegs)); diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s --- a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s @@ -1,5 +1,5 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t/test_x86-64.o %s +# RUN: llvm-mc --force-dwarf-unwind-info -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t/test_x86-64.o %s # RUN: llvm-rtdyld -triple=x86_64-apple-macosx10.9 -dummy-extern ds1=0xfffffffffffffffe -dummy-extern ds2=0xffffffffffffffff -verify -check=%s %t/test_x86-64.o .section __TEXT,__text,regular,pure_instructions diff --git a/llvm/test/MC/ELF/cfi-version.ll b/llvm/test/MC/ELF/cfi-version.ll --- a/llvm/test/MC/ELF/cfi-version.ll +++ b/llvm/test/MC/ELF/cfi-version.ll @@ -1,7 +1,7 @@ -; RUN: %llc_dwarf %s -o - -dwarf-version 2 -filetype=obj | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF2 -; RUN: %llc_dwarf %s -o - -dwarf-version 3 -filetype=obj | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF3 -; RUN: %llc_dwarf %s -o - -dwarf-version 4 -filetype=obj | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF4 -; RUN: %llc_dwarf %s -o - -dwarf-version 5 -filetype=obj | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF4 +; RUN: %llc_dwarf --force-dwarf-unwind-info %s -o - -dwarf-version 2 -filetype=obj | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF2 +; RUN: %llc_dwarf --force-dwarf-unwind-info %s -o - -dwarf-version 3 -filetype=obj | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF3 +; RUN: %llc_dwarf --force-dwarf-unwind-info %s -o - -dwarf-version 4 -filetype=obj | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF4 +; RUN: %llc_dwarf --force-dwarf-unwind-info %s -o - -dwarf-version 5 -filetype=obj | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF4 ; PR46647 ; XFAIL: arm64-apple diff --git a/llvm/test/MC/MachO/gen-dwarf64.s b/llvm/test/MC/MachO/gen-dwarf64.s --- a/llvm/test/MC/MachO/gen-dwarf64.s +++ b/llvm/test/MC/MachO/gen-dwarf64.s @@ -1,6 +1,6 @@ // This checks that llvm-mc is able to produce 64-bit debug info. -// RUN: llvm-mc -g -dwarf64 -triple x86_64-apple-darwin10 %s -filetype=obj -o %t +// RUN: llvm-mc -g --force-dwarf-unwind-info -dwarf64 -triple x86_64-apple-darwin10 %s -filetype=obj -o %t // RUN: llvm-dwarfdump -v %t | FileCheck %s // CHECK: .debug_info contents: diff --git a/llvm/test/MC/X86/compact-unwind-mode-dwarf.s b/llvm/test/MC/X86/compact-unwind-mode-dwarf.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/X86/compact-unwind-mode-dwarf.s @@ -0,0 +1,50 @@ +// RUN: llvm-mc -triple x86_64-apple-macos10.6 -filetype=obj %s -o %t.o +// RUN: llvm-objdump --macho --unwind-info --dwarf=frames %t.o | FileCheck %s + +/// For functions whose unwind info cannot be encoded with compact unwind, make +/// sure that we encode them using DWARF unwind, and make sure we emit a compact +/// unwind entry that indicates that a DWARF encoding is being used. + +_f: + .cfi_startproc + ## This encodes DW_CFA_GNU_args_size which cannot be expressed using compact + ## unwind, so we must use DWARF unwind instead. + .cfi_escape 0x2e, 0x10 + ret + .cfi_endproc + +_g: + .cfi_startproc + ## This encodes DW_CFA_GNU_args_size which cannot be expressed using compact + ## unwind, so we must use DWARF unwind instead. + .cfi_escape 0x2e, 0x10 + ret + .cfi_endproc + +// CHECK: Contents of __compact_unwind section: +// CHECK: Entry at offset 0x0: +// CHECK: start: 0x[[#%x,F:]] _f +// CHECK: length: 0x1 +// CHECK: compact encoding: 0x04000000 +// CHECK: Entry at offset 0x20: +// CHECK: start: 0x[[#%x,G:]] _g +// CHECK: length: 0x1 +// CHECK: compact encoding: 0x04000000 + +// CHECK: .eh_frame contents: +// CHECK: 00000000 00000014 00000000 CIE +// CHECK: Format: DWARF32 +// CHECK: Version: 1 +// CHECK: Augmentation: "zR" +// CHECK: Code alignment factor: 1 +// CHECK: Data alignment factor: -8 +// CHECK: Return address column: 16 +// CHECK: Augmentation data: 10 + +// CHECK: FDE cie=00000000 pc=[[#%.8x,F]]... +// CHECK: Format: DWARF32 +// CHECK: DW_CFA_GNU_args_size: +16 + +// CHECK: FDE cie=00000000 pc=[[#%.8x,G]]... +// CHECK: Format: DWARF32 +// CHECK: DW_CFA_GNU_args_size: +16 diff --git a/llvm/test/MC/X86/i386-darwin-frame-register.ll b/llvm/test/MC/X86/i386-darwin-frame-register.ll --- a/llvm/test/MC/X86/i386-darwin-frame-register.ll +++ b/llvm/test/MC/X86/i386-darwin-frame-register.ll @@ -1,4 +1,4 @@ -; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump -debug-frame - | FileCheck %s +; RUN: llc --force-dwarf-unwind-info -filetype=obj %s -o - | llvm-dwarfdump -debug-frame - | FileCheck %s ; IR reduced from a dummy: ; void foo() {} diff --git a/llvm/test/tools/dsymutil/X86/frame-1.test b/llvm/test/tools/dsymutil/X86/frame-1.test --- a/llvm/test/tools/dsymutil/X86/frame-1.test +++ b/llvm/test/tools/dsymutil/X86/frame-1.test @@ -1,6 +1,6 @@ # RUN: rm -rf %t # RUN: mkdir -p %t -# RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o +# RUN: llc --force-dwarf-unwind-info -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o # RUN: dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-frame - | FileCheck %s # This test is meant to verify that identical CIEs will get reused diff --git a/llvm/test/tools/dsymutil/X86/frame-2.test b/llvm/test/tools/dsymutil/X86/frame-2.test --- a/llvm/test/tools/dsymutil/X86/frame-2.test +++ b/llvm/test/tools/dsymutil/X86/frame-2.test @@ -1,7 +1,7 @@ # RUN: rm -rf %t # RUN: mkdir -p %t -# RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o -# RUN: llc -filetype=obj %p/../Inputs/frame-dw4.ll -o %t/frame-dw4.o +# RUN: llc --force-dwarf-unwind-info -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o +# RUN: llc --force-dwarf-unwind-info -filetype=obj %p/../Inputs/frame-dw4.ll -o %t/frame-dw4.o # RUN: dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-frame - | FileCheck %s # Check the handling of multiple different CIEs. To have CIEs that diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_frame_offset.test b/llvm/test/tools/llvm-dwarfdump/X86/debug_frame_offset.test --- a/llvm/test/tools/llvm-dwarfdump/X86/debug_frame_offset.test +++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_frame_offset.test @@ -1,4 +1,4 @@ -RUN: llc -filetype=obj %p/../../dsymutil/Inputs/frame-dw2.ll -o - \ +RUN: llc --force-dwarf-unwind-info -filetype=obj %p/../../dsymutil/Inputs/frame-dw2.ll -o - \ RUN: | llvm-dwarfdump -debug-frame=0x00000014 - | FileCheck %s CHECK: .debug_frame contents: CHECK-NEXT: 00000014 00000014 00000000 FDE cie=00000000 pc=00000000...0000001d