summary refs log tree commit diff stats
path: root/tests/accept/compile/tvarious.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/accept/compile/tvarious.nim')
-rw-r--r--tests/accept/compile/tvarious.nim43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/accept/compile/tvarious.nim b/tests/accept/compile/tvarious.nim
new file mode 100644
index 000000000..52dd46184
--- /dev/null
+++ b/tests/accept/compile/tvarious.nim
@@ -0,0 +1,43 @@
+# Test various aspects

+

+import

+  mvarious

+

+type

+  PA = ref TA

+  PB = ref TB

+

+  TB = object

+    a: PA

+

+  TA = object

+    b: TB

+    x: int

+

+proc getPA(): PA =

+  var

+    b: bool

+  b = not false

+  return nil

+

+var

+  global: int

+

+var

+  s: string

+  i: int

+  r: TA

+

+r.b.a.x = 0

+global = global + 1

+exportme()

+write(stdout, "Hallo wie heißt du? ")

+write(stdout, getPA().x)

+s = readLine(stdin)

+i = 0

+while i < s.len:

+  if s[i] == 'c': write(stdout, "'c' in deinem Namen gefunden\n")

+  i = i + 1

+

+write(stdout, "Du heißt " & s)

+