test(tests/lean/run/ubscalar): save UB scalar field test
This commit is contained in:
parent
1d0d65893b
commit
10fe453cf6
1 changed files with 16 additions and 0 deletions
16
tests/lean/run/ubscalar.lean
Normal file
16
tests/lean/run/ubscalar.lean
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
structure Foo :=
|
||||
(flag : Bool := false)
|
||||
(x : UInt16 := 0)
|
||||
(z : UInt32 := 0)
|
||||
(w : UInt64 := 0)
|
||||
(h : USize := 0)
|
||||
(xs : List Nat := [])
|
||||
|
||||
set_option trace.compiler.ir.init true
|
||||
|
||||
def f (s : Foo) : Foo :=
|
||||
{ x := s.x + 1, .. s }
|
||||
|
||||
def g (flag : Bool) : Foo :=
|
||||
let s : Foo := { x := 10, flag := flag };
|
||||
f s
|
||||
Loading…
Add table
Reference in a new issue