aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/34 logic ops/meson.build
blob: 897054e74ab4c19c6ac3c78c3e03442132b9dfe4 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
project('logicopts', 'c')

t = true
f = false

if (true)
  message('Ok.')
else
  error('Not ok.')
endif

if (false)
  error('Not ok.')
else
  message('Ok.')
endif

if (f)
  error('Not ok.')
else
  message('Ok.')
endif

if (t)
  message('Ok.')
else
  error('Not ok.')
endif

if true and t
  message('Ok.')
else
  error('Not ok.')
endif

if t and false
  error('Not ok.')
else
  message('Ok.')
endif

if f and t
  error('Not ok.')
else
  message('Ok.')
endif

if f or false
  error('Not ok.')
else
  message('Ok.')
endif

if true or f
  message('Ok.')
else
  error('Not ok.')
endif

if t or true
  message('Ok.')
else
  error('Not ok.')
endif

if not true
  error('Negation failed.')
else
  message('Ok.')
endif

if not f
  message('Ok.')
else
  error('Negation failed.')
endif


if f or f or f or f or f or f or f or f or t
  message('Ok.')
else
  error('Chain of ors failed.')
endif

if t and t and t and t and t and t and t and t and f
  error('Chain of ands failed.')
else
  message('Ok.')
endif

if t and t or t
  message('Ok.')
else
  error('Combination of and-or failed.')
endif