File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,7 @@ RUN(NAME expr_19 LABELS cpython llvm c)
494
494
RUN (NAME expr_20 LABELS cpython llvm c )
495
495
RUN (NAME expr_21 LABELS cpython llvm c )
496
496
RUN (NAME expr_22 LABELS cpython llvm c )
497
+ RUN (NAME expr_23 LABELS cpython llvm c )
497
498
498
499
RUN (NAME expr_01u LABELS cpython llvm c NOFAST )
499
500
RUN (NAME expr_02u LABELS cpython llvm c NOFAST )
Original file line number Diff line number Diff line change
1
+ from lpython import f32 , i32
2
+
3
+ def flip_sign_check ():
4
+ x : f32
5
+ eps : f32 = f32 (1e-5 )
6
+
7
+ number : i32 = 123
8
+ x = f32 (5.5 )
9
+
10
+ if (number % 2 == 1 ):
11
+ x = - x
12
+
13
+ assert abs (x - f32 (- 5.5 )) < eps
14
+
15
+ number = 124
16
+ x = f32 (5.5 )
17
+
18
+ if (number % 2 == 1 ):
19
+ x = - x
20
+
21
+ assert abs (x - f32 (5.5 )) < eps
22
+
23
+ flip_sign_check ()
You can’t perform that action at this time.
0 commit comments