github.com/llir/llvm@v0.3.6/ir/constant/constant_test.go (about)

     1  package constant
     2  
     3  // Assert that each constant implements the constant.Constant interface.
     4  var (
     5  	// Constant expressions.
     6  	_ Constant = Expression(nil)
     7  
     8  	// Constants.
     9  	_ Constant = (*Int)(nil)
    10  	_ Constant = (*Float)(nil)
    11  	_ Constant = (*Null)(nil)
    12  	_ Constant = (*NoneToken)(nil)
    13  	_ Constant = (*Struct)(nil)
    14  	_ Constant = (*Array)(nil)
    15  	_ Constant = (*CharArray)(nil)
    16  	_ Constant = (*Vector)(nil)
    17  	_ Constant = (*ZeroInitializer)(nil)
    18  	_ Constant = (*Undef)(nil)
    19  	_ Constant = (*Poison)(nil)
    20  	_ Constant = (*BlockAddress)(nil)
    21  )
    22  
    23  // Assert that each constant expression implements the constant.Expression interface.
    24  var (
    25  	// Binary expressions.
    26  	_ Expression = (*ExprAdd)(nil)
    27  	_ Expression = (*ExprFAdd)(nil)
    28  	_ Expression = (*ExprSub)(nil)
    29  	_ Expression = (*ExprFSub)(nil)
    30  	_ Expression = (*ExprMul)(nil)
    31  	_ Expression = (*ExprFMul)(nil)
    32  	_ Expression = (*ExprUDiv)(nil)
    33  	_ Expression = (*ExprSDiv)(nil)
    34  	_ Expression = (*ExprFDiv)(nil)
    35  	_ Expression = (*ExprURem)(nil)
    36  	_ Expression = (*ExprSRem)(nil)
    37  	_ Expression = (*ExprFRem)(nil)
    38  	// Bitwise expressions.
    39  	_ Expression = (*ExprShl)(nil)
    40  	_ Expression = (*ExprLShr)(nil)
    41  	_ Expression = (*ExprAShr)(nil)
    42  	_ Expression = (*ExprAnd)(nil)
    43  	_ Expression = (*ExprOr)(nil)
    44  	_ Expression = (*ExprXor)(nil)
    45  	// Vector expressions.
    46  	_ Expression = (*ExprExtractElement)(nil)
    47  	_ Expression = (*ExprInsertElement)(nil)
    48  	_ Expression = (*ExprShuffleVector)(nil)
    49  	// Aggregate expressions.
    50  	_ Expression = (*ExprExtractValue)(nil)
    51  	_ Expression = (*ExprInsertValue)(nil)
    52  	// Memory expressions.
    53  	_ Expression = (*ExprGetElementPtr)(nil)
    54  	// Conversion expressions.
    55  	_ Expression = (*ExprTrunc)(nil)
    56  	_ Expression = (*ExprZExt)(nil)
    57  	_ Expression = (*ExprSExt)(nil)
    58  	_ Expression = (*ExprFPTrunc)(nil)
    59  	_ Expression = (*ExprFPExt)(nil)
    60  	_ Expression = (*ExprFPToUI)(nil)
    61  	_ Expression = (*ExprFPToSI)(nil)
    62  	_ Expression = (*ExprUIToFP)(nil)
    63  	_ Expression = (*ExprSIToFP)(nil)
    64  	_ Expression = (*ExprPtrToInt)(nil)
    65  	_ Expression = (*ExprIntToPtr)(nil)
    66  	_ Expression = (*ExprBitCast)(nil)
    67  	_ Expression = (*ExprAddrSpaceCast)(nil)
    68  	// Other expressions.
    69  	_ Expression = (*ExprICmp)(nil)
    70  	_ Expression = (*ExprFCmp)(nil)
    71  	_ Expression = (*ExprSelect)(nil)
    72  )