summaryrefslogtreecommitdiff
path: root/bindings/go/llvm/string_test.go
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-18 16:17:27 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-18 16:17:27 +0000
commit67c32a98315f785a9ec9d531c1f571a0196c7463 (patch)
tree4abb9cbeecc7901726dd0b4a37369596c852e9ef /bindings/go/llvm/string_test.go
parent9f61947910e6ab40de38e6b4034751ef1513200f (diff)
Diffstat (limited to 'bindings/go/llvm/string_test.go')
-rw-r--r--bindings/go/llvm/string_test.go28
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 0000000000000..3008f3ef937c9
--- /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)
+ }
+}