Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cl/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,13 @@ func TestRunAndTestFromTestpy(t *testing.T) {
cltest.RunAndTestFromDir(t, "", "./_testpy", nil)
}

func TestRunAndTestFromTestpyDWARF(t *testing.T) {
conf := build.NewDefaultConf(build.ModeRun)
conf.LinkOptions.DWARF = build.DWARFPreserve
cltest.RunAndTestFromDir(t, "", "./_testpy", nil,
cltest.WithRunConfig(conf), cltest.WithIRCheck(false))
}

func TestRunAndTestFromTestlibgo(t *testing.T) {
cltest.RunAndTestFromDir(t, "", "./_testlibgo", nil)
}
Expand Down
5 changes: 5 additions & 0 deletions ssa/di.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,11 @@ const (
)

func (b Builder) DIGlobal(v Expr, name string, pos token.Position) {
// Frontend pseudo-variables, such as Python module attributes, have no
// native storage to describe or attach metadata to.
if v.impl.IsNil() {
return
}
if _, ok := b.Pkg.glbDbgVars[v]; ok {
return
}
Expand Down
5 changes: 5 additions & 0 deletions ssa/di_debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ type Shape struct {
}
}

func TestDIGlobalIgnoresStorageLessFrontendVariable(t *testing.T) {
var builder Builder
builder.DIGlobal(pyVarExpr(Nil, "attribute"), "module.attribute", token.Position{})
}

func newDebugRuntimePackage() *types.Package {
pkg := types.NewPackage(PkgRuntime, "runtime")
unsafePointer := types.Typ[types.UnsafePointer]
Expand Down
Loading