compiler: handle nested unsigned shift being untyped after type resolution (#5497)

* apply compiler patch for fix of #5496

* add compiler/testdata smoketest

* make diff error more explicit on difference

* apply golden fix
This commit is contained in:
Pat Whittingslow
2026-07-22 02:35:18 -03:00
committed by GitHub
parent 3ad913acb8
commit b536dd6f79
4 changed files with 66 additions and 28 deletions
+5
View File
@@ -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
}
+7
View File
@@ -176,6 +176,13 @@ entry:
ret { float, float } %3
}
; Function Attrs: nounwind
define hidden i64 @main.shiftNested(i64 %x, ptr %context) unnamed_addr #1 {
entry:
%0 = lshr i64 %x, 8
ret i64 %0
}
; Function Attrs: nounwind
define hidden { float, float } @main.complexMul(float %x.r, float %x.i, float %y.r, float %y.i, ptr %context) unnamed_addr #1 {
entry: