summaryrefslogtreecommitdiff
path: root/ocaml-binary-annot/camlp4/test/fixtures/macrotest.ml
blob: 023a5b4262bebc13630f5af3718245363467dd3a (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
DEFINE A = 42;
DEFINE B = 51;

IFDEF A THEN
  value a_should_be_present = B + 2;
  print_int (a_should_be_present + 1);
ENDIF;

print_int (a_should_be_present + 2);

IFNDEF C THEN
  print_int (a_should_be_present + 3);
ENDIF;

IFNDEF C THEN
  print_int (a_should_be_present + 4);
ELSE
  print_int (c_should_not_be_present + 1);
ENDIF;

IFDEF C THEN
  print_int (c_should_not_be_present + 2);
ELSIF
  print_int (A * a_should_be_present + 5);
ENDIF;

IFDEF DNE THEN
  print_int (c_should_not_be_present + 2);
ELSIF
  print_int (A * a_should_be_present + 5);
ENDIF;

IFDEF OPT THEN
  print_int (c_should_not_be_present + 2);
ELSIF
  print_int (A * a_should_be_present + 5);
ENDIF;

value e = 
  IFDEF DNE THEN
    print_int (c_should_not_be_present + 2)
  ELSE
    print_int (A * a_should_be_present + 5)
  ENDIF;

value f =
  fun _ ->
    IFDEF DNE THEN
      print_int (c_should_not_be_present + 2)
    ELSE
      print_int (A * a_should_be_present + 5)
    ENDIF;

IFDEF A THEN
  DEFINE Z = "ok";
ELSE
  DEFINE Z = "ko";
ENDIF;

Z;

IFDEF DNE THEN
  DEFINE Z = "ko2";
ELSE
  DEFINE Z = "ok2";
ENDIF;

Z;

pouet;