Skip to content

Commit

Permalink
example: add named return type
Browse files Browse the repository at this point in the history
  • Loading branch information
douyixuan committed Aug 15, 2024
1 parent 2277b66 commit 101c099
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ test/example:
${CELL} -d -t riscv tests/examples/panic.cell && ckb-debugger --bin panic | grep "runtime panic: hah"
${CELL} -d -t riscv tests/examples/if-cond.cell && ckb-debugger --bin if-cond | grep "100:0:ss"
${CELL} -d -t riscv tests/examples/return.cell && ckb-debugger --bin return
${CELL} -d -t riscv tests/examples/named-ret-type.cell && ckb-debugger --bin named-ret-type | grep "0"
${CELL} -d -t riscv tests/examples/func.cell && ckb-debugger --bin func | grep "999"
${CELL} -t riscv tests/examples/cell-data.cell && ckb-debugger --bin cell-data
${CELL} -t riscv tests/examples/inputs.cell && ckb-debugger --bin inputs
Expand Down
9 changes: 9 additions & 0 deletions tests/examples/named-ret-type.cell
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import "debug"
func foo() (ret uint64) {
return
}
func main() {
a := foo()
debug.Printf("%d", a)
return 0
}

0 comments on commit 101c099

Please sign in to comment.