-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
06dfd31
commit de74362
Showing
4 changed files
with
44 additions
and
7 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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#[ | ||
this test will grow with more importc+importcpp tests; see driver in trunner.nim | ||
]# | ||
|
||
{.emit:""" | ||
struct A { | ||
static int fun0(int a){ | ||
return a; | ||
} | ||
static int& fun1(int& a){ | ||
return a; | ||
} | ||
}; | ||
""".} | ||
|
||
proc fun0*(a: cint): int {.importcpp:"A::$1(@)".} | ||
proc fun1*(a: var cint): var int {.importcpp:"A::$1(@)".} = | ||
## some comment; this test is for #14314 | ||
runnableExamples: discard | ||
|
||
proc main()= | ||
var a = 10.cint | ||
doAssert fun0(a) == a | ||
doAssert fun1(a).addr == a.addr | ||
echo "witness" | ||
main() |
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