ceremonyclient/bedlam/testsuite/lang/ptr_struct_field.qcl
Cassandra Heart e51992f3e8
OT
2025-03-23 21:11:16 -05:00

25 lines
257 B
Go

// -*- go -*-
package main
type Foo struct {
A int32
B int32
}
func Set(ptr *int32, val int32) {
*ptr = val
}
var f Foo
// @Test 0 0 = 0
// @Test 1 2 = 3
// @Test 7 4 = 11
func main(a, b int32) int {
Set(&f.A, a)
Set(&f.B, b)
return f.A + f.B
}