MCPcopy Create free account
hub / github.com/llir/llvm / TestModuleString

Function TestModuleString

ir/ir_test.go:13–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestModuleString(t *testing.T) {
14 golden := []struct {
15 in *Module
16 want string
17 }{
18 // Empty module.
19 {
20 in: &Module{},
21 want: "",
22 },
23 // Type definition.
24 {
25 in: &Module{
26 TypeDefs: []types.Type{&types.StructType{
27 TypeName: "foo",
28 Fields: []types.Type{types.I32},
29 }},
30 },
31 want: "%foo = type { i32 }",
32 },
33 }
34 for _, g := range golden {
35 got := strings.TrimSpace(g.in.String())
36 if g.want != got {
37 t.Errorf("module mismatch; expected `%v`, got `%v`", g.want, got)
38 }
39 }
40}
41
42// Assert that each constant implements the constant.Constant interface.
43var (

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…