Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions compiler/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,19 +420,19 @@ func (c *compilerContext) makeLLVMType(goType types.Type) llvm.Type {
return c.ctx.Int8Type()
case types.Int16, types.Uint16:
return c.ctx.Int16Type()
case types.Int32, types.Uint32:
case types.Int32, types.Uint32, types.UntypedRune:
return c.ctx.Int32Type()
case types.Int, types.Uint:
case types.Int, types.Uint, types.UntypedInt:
return c.intType
case types.Int64, types.Uint64:
return c.ctx.Int64Type()
case types.Float32:
return c.ctx.FloatType()
case types.Float64:
case types.Float64, types.UntypedFloat:
return c.ctx.DoubleType()
case types.Complex64:
return c.ctx.StructType([]llvm.Type{c.ctx.FloatType(), c.ctx.FloatType()}, false)
case types.Complex128:
case types.Complex128, types.UntypedComplex:
return c.ctx.StructType([]llvm.Type{c.ctx.DoubleType(), c.ctx.DoubleType()}, false)
case types.String, types.UntypedString:
return c.getLLVMRuntimeType("_string")
Expand Down
5 changes: 5 additions & 0 deletions compiler/testdata/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ func complexSub(x, y complex64) complex64 {
return x - y
}

func shiftNested(x uint64) uint64 {
k := 3
return x >> (1 << k) // https://github.com/tinygo-org/tinygo/issues/5496
}

func complexMul(x, y complex64) complex64 {
return x * y
}
Expand Down
Loading