summary refs log tree commit diff stats
path: root/tests/accept/compile/tprep.nim
blob: 999b2f57fc5b6c58013d145a3d5f7ac1dd823e1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Test the features that used to belong to the preprocessor

import
  times

{.warning: "This is only a test warning!".}

{.define: case2.}
{.define: case3.}
when defined(case1):
  {.hint: "Case 1".}
  when defined(case3):
    {.hint: "Case 1.3".}
elif defined(case2):
  {.hint: "Case 2".}
  when defined(case3):
    {.hint: "Case 2.3".}
elif defined(case3):
  {.hint: "Case 3".}
else:
  {.hint: "unknown case".}

var
  s: string
write(stdout, "compiled at " & system.compileDate &
              " " & compileTime & "\n")
echo getDateStr()
echo getClockStr()