Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0469b85
commit f6893f2
Showing
1 changed file
with
22 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
discard """ | ||
exitcode: 1 | ||
targets: "c js cpp" | ||
matrix: "-d:debug; -d:release" | ||
outputsub: ''' and works fine! [Exception]''' | ||
disabled: openbsd | ||
""" | ||
#[ | ||
disabled: openbsd: just for js | ||
]# | ||
const msg = "This char is `" & '\0' & "` and works fine!" | ||
|
||
# bug #13115 | ||
|
||
template fn = | ||
var msg = "This char is `" & '\0' & "` and works fine!" | ||
raise newException(Exception, msg) | ||
# static: fn() # would also work | ||
fn() | ||
when defined nim_t13115: | ||
# bug #13115 | ||
template fn = | ||
raise newException(Exception, msg) | ||
when defined nim_t13115_static: | ||
static: fn() | ||
fn() | ||
else: | ||
import std/[osproc,strformat,os,strutils] | ||
proc main = | ||
const nim = getCurrentCompilerExe() | ||
const file = currentSourcePath | ||
for b in "c js cpp".split: | ||
when defined(openbsd): | ||
if b == "js": continue # xxx bug: pending #13115 | ||
for opt in ["-d:nim_t13115_static", ""]: | ||
let cmd = fmt"{nim} r -b:{b} -d:nim_t13115 {opt} --hints:off {file}" | ||
let (outp, exitCode) = execCmdEx(cmd) | ||
doAssert msg in outp, cmd & "\n" & msg | ||
doAssert exitCode == 1 | ||
main() |