summary refs log tree commit diff stats
path: root/tests/cpp/tcasts.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpp/tcasts.nim')
-rw-r--r--tests/cpp/tcasts.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/cpp/tcasts.nim b/tests/cpp/tcasts.nim
new file mode 100644
index 000000000..24ebb8f62
--- /dev/null
+++ b/tests/cpp/tcasts.nim
@@ -0,0 +1,11 @@
+discard """
+  cmd: "nim cpp $file"
+  output: ""
+  targets: "cpp"
+"""
+
+block: #5979
+  var a = 'a'
+  var p: pointer = cast[pointer](a)
+  var c = cast[char](p)
+  doAssert(c == 'a')