diff options
Diffstat (limited to 'bindings/go/llvm/string_test.go')
-rw-r--r-- | bindings/go/llvm/string_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bindings/go/llvm/string_test.go b/bindings/go/llvm/string_test.go new file mode 100644 index 000000000000..3008f3ef937c --- /dev/null +++ b/bindings/go/llvm/string_test.go @@ -0,0 +1,28 @@ +//===- string_test.go - test Stringer implementation for Type -------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests the Stringer interface for the Type type. +// +//===----------------------------------------------------------------------===// + +package llvm + +import ( + "testing" +) + +func TestStringRecursiveType(t *testing.T) { + ctx := NewContext() + defer ctx.Dispose() + s := ctx.StructCreateNamed("recursive") + s.StructSetBody([]Type{s, s}, false) + if str := s.String(); str != "%recursive: StructType(%recursive, %recursive)" { + t.Errorf("incorrect string result %q", str) + } +} |