@@ -411,6 +411,8 @@ Definition testSliceLiteral {ext : ffi_syntax} {go_gctx : GoGlobalContext} : go_
411411
412412Definition testSliceAppend {ext : ffi_syntax} {go_gctx : GoGlobalContext} : go_string := "github.com/goose-lang/goose/testdata/examples/semantics.testSliceAppend"%go.
413413
414+ Definition testSliceRef {ext : ffi_syntax} {go_gctx : GoGlobalContext} : go_string := "github.com/goose-lang/goose/testdata/examples/semantics.testSliceRef"%go.
415+
414416Definition testFooBarMutation {ext : ffi_syntax} {go_gctx : GoGlobalContext} : go_string := "github.com/goose-lang/goose/testdata/examples/semantics.testFooBarMutation"%go.
415417
416418Definition NewS {ext : ffi_syntax} {go_gctx : GoGlobalContext} : go_string := "github.com/goose-lang/goose/testdata/examples/semantics.NewS"%go.
@@ -2402,7 +2404,7 @@ Definition testSliceOpsⁱᵐᵖˡ {ext : ffi_syntax} {go_gctx : GoGlobalContext
24022404 Slice (go.SliceType go.uint64) ("$s", #(W64 0), #(W64 3))) in
24032405 do: ("v3" <-[go.SliceType go.uint64] "$r0");;;
24042406 let : "v4" := (GoAlloc (go.PointerType go.uint64) (GoZeroVal (go.PointerType go.uint64) #())) in
2405- let : "$r0" := (IndexRef go.uint64 (![go.SliceType go.uint64] "x", #(W64 2))) in
2407+ let : "$r0" := (IndexRef ( go.SliceType go. uint64) (![go.SliceType go.uint64] "x", #(W64 2))) in
24062408 do: ("v4" <-[go.PointerType go.uint64] "$r0");;;
24072409 let : "ok" := (GoAlloc go.bool (GoZeroVal go.bool #())) in
24082410 let : "$r0" := #true in
@@ -2563,6 +2565,19 @@ Definition testSliceAppendⁱᵐᵖˡ {ext : ffi_syntax} {go_gctx : GoGlobalCont
25632565 do: ("ok" <-[go.bool] "$r0");;;
25642566 return : (![go.bool] "ok")).
25652567
2568+ (* go: slices.go:100:6 *)
2569+ Definition testSliceRefⁱᵐᵖˡ {ext : ffi_syntax} {go_gctx : GoGlobalContext} : val :=
2570+ λ: <>,
2571+ exception_do (let : "sl" := (GoAlloc (go.SliceType go.uint64) (GoZeroVal (go.SliceType go.uint64) #())) in
2572+ let : "$r0" := ((FuncResolve go.make2 [go.SliceType go.uint64] #()) #(W64 5)) in
2573+ do: ("sl" <-[go.SliceType go.uint64] "$r0");;;
2574+ let : "ptr" := (GoAlloc (go.PointerType go.uint64) (GoZeroVal (go.PointerType go.uint64) #())) in
2575+ let : "$r0" := (IndexRef (go.SliceType go.uint64) (![go.SliceType go.uint64] "sl", #(W64 0))) in
2576+ do: ("ptr" <-[go.PointerType go.uint64] "$r0");;;
2577+ let : "$r0" := #(W64 1) in
2578+ do: ((![go.PointerType go.uint64] "ptr") <-[go.uint64] "$r0");;;
2579+ return : ((![go.uint64] (IndexRef (go.SliceType go.uint64) (![go.SliceType go.uint64] "sl", #(W64 0)))) =⟨go.uint64⟩ #(W64 1))).
2580+
25662581(* go: struct_pointers.go:14:17 *)
25672582Definition Bar__mutateⁱᵐᵖˡ {ext : ffi_syntax} {go_gctx : GoGlobalContext} : val :=
25682583 λ: "bar" <>,
@@ -4486,6 +4501,7 @@ Class Assumptions `{!GoGlobalContext} `{!GoLocalContext} `{!GoSemanticsFunctions
44864501 #[global] testOverwriteArray_unfold :: FuncUnfold testOverwriteArray [] (testOverwriteArrayⁱᵐᵖˡ);
44874502 #[global] testSliceLiteral_unfold :: FuncUnfold testSliceLiteral [] (testSliceLiteralⁱᵐᵖˡ);
44884503 #[global] testSliceAppend_unfold :: FuncUnfold testSliceAppend [] (testSliceAppendⁱᵐᵖˡ);
4504+ #[global] testSliceRef_unfold :: FuncUnfold testSliceRef [] (testSliceRefⁱᵐᵖˡ);
44894505 #[global] testFooBarMutation_unfold :: FuncUnfold testFooBarMutation [] (testFooBarMutationⁱᵐᵖˡ);
44904506 #[global] NewS_unfold :: FuncUnfold NewS [] (NewSⁱᵐᵖˡ);
44914507 #[global] testStructUpdates_unfold :: FuncUnfold testStructUpdates [] (testStructUpdatesⁱᵐᵖˡ);
0 commit comments