MCPcopy Create free account
hub / github.com/google/pprof / TestObjdumpVersionChecks

Function TestObjdumpVersionChecks

internal/binutils/binutils_test.go:571–658  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

569}
570
571func TestObjdumpVersionChecks(t *testing.T) {
572 // Test that the objdump version strings are parsed properly.
573 type testcase struct {
574 desc string
575 os string
576 ver string
577 want bool
578 }
579
580 for _, tc := range []testcase{
581 {
582 desc: "Valid Apple LLVM version string with usable version",
583 os: "darwin",
584 ver: "Apple LLVM version 11.0.3 (clang-1103.0.32.62)\nOptimized build.",
585 want: true,
586 },
587 {
588 desc: "Valid Apple LLVM version string with unusable version",
589 os: "darwin",
590 ver: "Apple LLVM version 10.0.0 (clang-1000.11.45.5)\nOptimized build.",
591 want: false,
592 },
593 {
594 desc: "Invalid Apple LLVM version string with usable version",
595 os: "darwin",
596 ver: "Apple LLVM versions 11.0.3 (clang-1103.0.32.62)\nOptimized build.",
597 want: false,
598 },
599 {
600 desc: "Valid LLVM version string with usable version",
601 os: "linux",
602 ver: "LLVM (http://llvm.org/):\nLLVM version 9.0.1\n\nOptimized build.",
603 want: true,
604 },
605 {
606 desc: "Valid LLVM version string with unusable version",
607 os: "linux",
608 ver: "LLVM (http://llvm.org/):\nLLVM version 6.0.1\n\nOptimized build.",
609 want: false,
610 },
611 {
612 desc: "Invalid LLVM version string with usable version",
613 os: "linux",
614 ver: "LLVM (http://llvm.org/):\nLLVM versions 9.0.1\n\nOptimized build.",
615 want: false,
616 },
617 {
618 desc: "Valid LLVM objdump version string with trunk",
619 os: runtime.GOOS,
620 ver: "LLVM (http://llvm.org/):\nLLVM version custom-trunk 124ffeb592a00bfe\nOptimized build.",
621 want: true,
622 },
623 {
624 desc: "Invalid LLVM objdump version string with trunk",
625 os: runtime.GOOS,
626 ver: "LLVM (http://llvm.org/):\nLLVM version custom-trank 124ffeb592a00bfe\nOptimized build.",
627 want: false,
628 },

Callers

nothing calls this directly

Calls 2

isLLVMObjdumpFunction · 0.85
isBuObjdumpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…