[InstCombine] Signed saturation patterns
[llvm-core.git] / bindings / go / llvm / string_test.go
blob56cbc9f3e7fd0f2711764e884b54216c174cee59
1 //===- string_test.go - test Stringer implementation for Type -------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file tests the Stringer interface for the Type type.
11 //===----------------------------------------------------------------------===//
13 package llvm
15 import (
16 "testing"
19 func TestStringRecursiveType(t *testing.T) {
20 ctx := NewContext()
21 defer ctx.Dispose()
22 s := ctx.StructCreateNamed("recursive")
23 s.StructSetBody([]Type{s, s}, false)
24 if str := s.String(); str != "%recursive: StructType(%recursive, %recursive)" {
25 t.Errorf("incorrect string result %q", str)