diff options
author | Ayke van Laethem <[email protected]> | 2023-07-06 22:14:55 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2023-08-04 11:59:11 +0200 |
commit | f791c821ff5d393c875fe41889b94c19cf5f508d (patch) | |
tree | cdb93c55f2e6094be063cc384187d17a89e81aad /testdata | |
parent | a93f0ed12a30d694ad8db2a2636b1247e772c3e8 (diff) | |
download | tinygo-f791c821ff5d393c875fe41889b94c19cf5f508d.tar.gz tinygo-f791c821ff5d393c875fe41889b94c19cf5f508d.zip |
compiler: add min and max builtin support
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/go1.21.go | 12 | ||||
-rw-r--r-- | testdata/go1.21.txt | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/testdata/go1.21.go b/testdata/go1.21.go new file mode 100644 index 000000000..885e588da --- /dev/null +++ b/testdata/go1.21.go @@ -0,0 +1,12 @@ +package main + +func main() { + ia := 1 + ib := 5 + ic := -3 + fa := 1.0 + fb := 5.0 + fc := -3.0 + println("min/max:", min(ia, ib, ic), max(ia, ib, ic)) + println("min/max:", min(fa, fb, fc), max(fa, fb, fc)) +} diff --git a/testdata/go1.21.txt b/testdata/go1.21.txt new file mode 100644 index 000000000..ad81dcfe9 --- /dev/null +++ b/testdata/go1.21.txt @@ -0,0 +1,2 @@ +min/max: -3 5 +min/max: -3.000000e+000 +5.000000e+000 |