summary refs log tree commit diff stats
path: root/tests/misc/tdllvar.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/tdllvar.nim')
-rw-r--r--tests/misc/tdllvar.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/misc/tdllvar.nim b/tests/misc/tdllvar.nim
new file mode 100644
index 000000000..68029ddf4
--- /dev/null
+++ b/tests/misc/tdllvar.nim
@@ -0,0 +1,18 @@
+discard """
+disabled: true
+"""
+
+import os
+
+proc getDllName: string =
+  result = "mylib.dll"
+  if fileExists(result): return
+  result = "mylib2.dll"
+  if fileExists(result): return
+  quit("could not load dynamic library")
+
+proc myImport(s: cstring) {.cdecl, importc, dynlib: getDllName().}
+proc myImport2(s: int) {.cdecl, importc, dynlib: getDllName().}
+
+myImport("test2")
+myImport2(12)