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
// Test: Operator precedence with negation and logical OR
// Bug: Compiler was stripping parentheses from !(a || b)
// Generated: !a || b (wrong precedence)
// Expected: !(a || b) (correct precedence)
fn test_negation_with_or() -> bool {
let a = true
let b = false
// This should negate the entire OR expression
// !(true || false) = !true = false
return !(a || b)
}
fn test_negation_with_and() -> bool {
let a = true
let b = false
// This should negate the entire AND expression
// !(true && false) = !false = true
return !(a && b)
}
fn test_negation_complex() -> bool {
let x = 5.0
let y = 10.0
let min = 0.0
let max = 20.0
// Check if value is OUT OF BOUNDS (negation of in-bounds check)
// !(x >= min && x <= max && y >= min && y <= max)
return !(x >= min && x <= max && y >= min && y <= max)
}