drnim: phi nodes for 'if' statements (#13990)
This commit is contained in:
parent
f1ee817627
commit
a8f030fea2
2 changed files with 172 additions and 15 deletions
23
drnim/tests/tphi.nim
Normal file
23
drnim/tests/tphi.nim
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
discard """
|
||||
nimout: '''tphi.nim(9, 10) Warning: BEGIN [User]
|
||||
tphi.nim(22, 10) Warning: END [User]'''
|
||||
cmd: "drnim $file"
|
||||
action: "compile"
|
||||
"""
|
||||
import std/logic
|
||||
{.push staticBoundChecks: defined(nimDrNim).}
|
||||
{.warning: "BEGIN".}
|
||||
|
||||
proc testAsgn(y: int) =
|
||||
var a = y
|
||||
if a > 0:
|
||||
if a > 3:
|
||||
a = a + 2
|
||||
else:
|
||||
a = a + 1
|
||||
{.assert: a > 1.}
|
||||
|
||||
testAsgn(3)
|
||||
|
||||
{.warning: "END".}
|
||||
{.pop.}
|
||||
Loading…
Add table
Add a link
Reference in a new issue