23 lines · cpp
1void f1() {}2__attribute__((always_inline)) inline void f2() {3 f1();4}5// throw a gap in the address range to force use of DW_AT_ranges, ranges_base,6// range contribution in the .dwo file, etc.7__attribute__((nodebug)) void gap() {8}9int main() {10 f2();11}12 13// To produce split-dwarf-dwp.o{,dwp}, Create another file that has ranges, so14// the ranges_base of the CU for split-dwarf-dwp.cpp is non-zero.15//16// $ cat > other.cpp17// void other1() {}18// __attribute__((nodebug)) void other2() {}19// void other3() {}20// $ clang++ other.cpp split-dwarf-dwp.cpp -gsplit-dwarf -c -Xclang -fdebug-compilation-dir -Xclang . -fno-split-dwarf-inlining21// $ llvm-dwp other.dwo split-dwarf-dwp.dwo -o test/DebugInfo/Inputs/split-dwarf-dwp.o.dwp22// $ ld -r other.o split-dwarf-dwp.o -o test/DebugInfo/Inputs/split-dwarf-dwp.o23