Skip to content

Commit

Permalink
Array.Spec: disable optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Unisay committed Jan 29, 2025
1 parent d0176bb commit 8fa85c4
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 10 deletions.
27 changes: 26 additions & 1 deletion plutus-tx-plugin/test/Array/9.6/compiledIndexArray.pir.golden
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
indexArray {data} [I 1, I 2, I 3] 2
(let
!indexArray : all a. array a -> integer -> a = indexArray
in
indexArray {data})
(let
!unitval : unit = ()
in
let
!mkNilData : unit -> list data = mkNilData
in
let
!mkI : integer -> data = iData
in
let
!mkCons : all a. a -> list a -> list a = mkCons
in
let
!listToArray : all a. list a -> array a = listToArray
in
listToArray
{data}
(mkCons
{data}
(mkI 1)
(mkCons {data} (mkI 2) (mkCons {data} (mkI 3) (mkNilData unitval)))))
2
22 changes: 21 additions & 1 deletion plutus-tx-plugin/test/Array/9.6/compiledIndexArray.uplc.golden
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
(program 1.1.0 (force indexArray [I 1, I 2, I 3] 2))
(program
1.1.0
((\indexArray -> force indexArray)
indexArray
((\unitval ->
(\mkNilData ->
(\mkI ->
(\mkCons ->
(\listToArray ->
force listToArray
(force mkCons
(mkI 1)
(force mkCons
(mkI 2)
(force mkCons (mkI 3) (mkNilData unitval)))))
listToArray)
mkCons)
iData)
mkNilData)
())
2))
26 changes: 25 additions & 1 deletion plutus-tx-plugin/test/Array/9.6/compiledLengthArray.pir.golden
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
lengthArray {data} [I 1, I 2, I 3]
(let
!lengthOfArray : all a. array a -> integer = lengthArray
in
lengthOfArray {data})
(let
!unitval : unit = ()
in
let
!mkNilData : unit -> list data = mkNilData
in
let
!mkI : integer -> data = iData
in
let
!mkCons : all a. a -> list a -> list a = mkCons
in
let
!listToArray : all a. list a -> array a = listToArray
in
listToArray
{data}
(mkCons
{data}
(mkI 1)
(mkCons {data} (mkI 2) (mkCons {data} (mkI 3) (mkNilData unitval)))))
21 changes: 20 additions & 1 deletion plutus-tx-plugin/test/Array/9.6/compiledLengthArray.uplc.golden
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
(program 1.1.0 (force lengthArray [I 1, I 2, I 3]))
(program
1.1.0
((\lengthOfArray -> force lengthOfArray)
lengthArray
((\unitval ->
(\mkNilData ->
(\mkI ->
(\mkCons ->
(\listToArray ->
force listToArray
(force mkCons
(mkI 1)
(force mkCons
(mkI 2)
(force mkCons (mkI 3) (mkNilData unitval)))))
listToArray)
mkCons)
iData)
mkNilData)
())))
22 changes: 21 additions & 1 deletion plutus-tx-plugin/test/Array/9.6/compiledListToArray.pir.golden
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
[I 1, I 2, I 3]
let
!unitval : unit = ()
in
let
!mkNilData : unit -> list data = mkNilData
in
let
!mkI : integer -> data = iData
in
let
!mkCons : all a. a -> list a -> list a = mkCons
in
let
!listToArray : all a. list a -> array a = listToArray
in
listToArray
{data}
(mkCons
{data}
(mkI 1)
(mkCons {data} (mkI 2) (mkCons {data} (mkI 3) (mkNilData unitval))))
19 changes: 18 additions & 1 deletion plutus-tx-plugin/test/Array/9.6/compiledListToArray.uplc.golden
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
(program 1.1.0 [I 1, I 2, I 3])
(program
1.1.0
((\unitval ->
(\mkNilData ->
(\mkI ->
(\mkCons ->
(\listToArray ->
force listToArray
(force mkCons
(mkI 1)
(force mkCons
(mkI 2)
(force mkCons (mkI 3) (mkNilData unitval)))))
listToArray)
mkCons)
iData)
mkNilData)
()))
14 changes: 10 additions & 4 deletions plutus-tx-plugin/test/Array/Spec.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -fplugin PlutusTx.Plugin #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:max-simplifier-iterations-pir=0 #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:max-simplifier-iterations-uplc=0 #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:max-cse-iterations=0 #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-optimize #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-simplifier-beta #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-simplifier-evaluate-builtins #-}

module Array.Spec where

Expand Down

0 comments on commit 8fa85c4

Please sign in to comment.