Skip to content

Commit

Permalink
Updated reference tests
Browse files Browse the repository at this point in the history
  • Loading branch information
czgdp1807 committed Sep 12, 2023
1 parent 33c5bd8 commit e10fd99
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 47 deletions.
2 changes: 1 addition & 1 deletion integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ RUN(NAME enum_06 LABELS cpython llvm c)
RUN(NAME enum_07 IMPORT_PATH ..
LABELS cpython llvm c)
RUN(NAME union_01 LABELS cpython llvm c)
RUN(NAME union_02 LABELS cpython llvm c)
RUN(NAME union_02 LABELS cpython llvm c NOFAST)
RUN(NAME union_03 LABELS cpython llvm c)
RUN(NAME union_04 IMPORT_PATH ..
LABELS cpython llvm c)
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-generics_01-d616074.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "asr-generics_01-d616074.stdout",
"stdout_hash": "dfabe5a70a7f43494584ff8aeda7b7c86ed518fae456658f1f534daf",
"stdout_hash": "a86dbbc3855a11fac0c305599cd98e368c31b0fc172e78dfc1fe484b",
"stderr": null,
"stderr_hash": null,
"returncode": 0
Expand Down
4 changes: 2 additions & 2 deletions tests/reference/asr-generics_01-d616074.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
.false.
.false.
.false.
[]
[2 add]
.false.
)
[add_integer]
Expand Down Expand Up @@ -185,7 +185,7 @@
.false.
.false.
.false.
[]
[2 add]
.false.
)
[add_string]
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-generics_array_02-22c8dc1.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "asr-generics_array_02-22c8dc1.stdout",
"stdout_hash": "2132824b968d01dc0f0c0943bbdeb17e3c6a04caf2775065a397e1b2",
"stdout_hash": "d128fe83fd89823c14327513eda9881dd56fb771acc0f0962cf42163",
"stderr": null,
"stderr_hash": null,
"returncode": 0
Expand Down
12 changes: 4 additions & 8 deletions tests/reference/asr-generics_array_02-22c8dc1.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
.false.
.false.
.false.
[]
[2 add]
.false.
)
[add_integer]
Expand All @@ -170,9 +170,7 @@
(ArrayConstant
[]
(Array
(TypeParameter
T
)
(Integer 4)
[((IntegerConstant 0 (Integer 4))
(Var 206 n))]
PointerToDataArray
Expand Down Expand Up @@ -384,7 +382,7 @@
.false.
.false.
.false.
[]
[2 add]
.false.
)
[add_float]
Expand All @@ -396,9 +394,7 @@
(ArrayConstant
[]
(Array
(TypeParameter
T
)
(Real 4)
[((IntegerConstant 0 (Integer 4))
(Var 207 n))]
PointerToDataArray
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-generics_array_03-fb3706c.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "asr-generics_array_03-fb3706c.stdout",
"stdout_hash": "34635ce31c2595c83083daa522e86fa0b4fa7e1b9916dfa49808583f",
"stdout_hash": "871f0e298031815ca0a9988f6bae910350bec1f086c07179d67056f8",
"stderr": null,
"stderr_hash": null,
"returncode": 0
Expand Down
12 changes: 4 additions & 8 deletions tests/reference/asr-generics_array_03-fb3706c.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
.false.
.false.
.false.
[]
[2 add]
.false.
)
[add_integer]
Expand All @@ -264,9 +264,7 @@
(ArrayConstant
[]
(Array
(TypeParameter
T
)
(Integer 4)
[((IntegerConstant 0 (Integer 4))
(Var 207 n))
((IntegerConstant 0 (Integer 4))
Expand Down Expand Up @@ -598,7 +596,7 @@
.false.
.false.
.false.
[]
[2 add]
.false.
)
[add_float]
Expand All @@ -611,9 +609,7 @@
(ArrayConstant
[]
(Array
(TypeParameter
T
)
(Real 4)
[((IntegerConstant 0 (Integer 4))
(Var 208 n))
((IntegerConstant 0 (Integer 4))
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/asr-generics_list_01-39c4044.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "asr-generics_list_01-39c4044.stdout",
"stdout_hash": "d53f6f826430b0aa861db8f7932cdd9f24d61cddb7527ad97b61b595",
"stdout_hash": "1b67e64b1337c59fb1f94f0afe307382c49ce404d59e61fc657c5225",
"stderr": null,
"stderr_hash": null,
"returncode": 0
Expand Down
12 changes: 9 additions & 3 deletions tests/reference/asr-generics_list_01-39c4044.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@
.false.
.false.
.false.
[]
[2 zero
2 add
2 div]
.false.
)
[empty_integer
Expand Down Expand Up @@ -332,7 +334,9 @@
.false.
.false.
.false.
[]
[2 zero
2 add
2 div]
.false.
)
[empty_float
Expand Down Expand Up @@ -537,7 +541,9 @@
.false.
.false.
.false.
[]
[2 zero
2 add
2 div]
.false.
)
[empty_string
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/c-expr7-bb2692a.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outfile": null,
"outfile_hash": null,
"stdout": "c-expr7-bb2692a.stdout",
"stdout_hash": "241378f1e16504e72b5ed9ad7fc0fa88ecfafb0373b545bf381a9397",
"stdout_hash": "92e36dc1146bef152cab7c8086ce6de203a3d966dc5415331bd27257",
"stderr": "c-expr7-bb2692a.stderr",
"stderr_hash": "6e9790ac88db1a9ead8f64a91ba8a6605de67167037908a74b77be0c",
"returncode": 0
Expand Down
2 changes: 1 addition & 1 deletion tests/reference/c-expr7-bb2692a.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ double _lfortran_zaimag(double_complex_t x);
void test_pow()
{
int32_t a;
a = (int32_t)(__lpython_overloaded_0__pow(2, 2));
a = (int32_t)( 4.00000000000000000e+00);
}

int32_t test_pow_1(int32_t a, int32_t b)
Expand Down
13 changes: 13 additions & 0 deletions tests/reference/llvm-structs_11-09fea6a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "llvm-structs_11-09fea6a",
"cmd": "lpython --no-color --show-llvm {infile} -o {outfile}",
"infile": "tests/structs_11.py",
"infile_hash": "9cb6c80ad837ba66472a91b22e9068ec439b6a2a179a452d90d84c78",
"outfile": null,
"outfile_hash": null,
"stdout": "llvm-structs_11-09fea6a.stdout",
"stdout_hash": "c6cdeacf6cdb7b9a5e68d2263a28585e68ec51e11f544fd366eac428",
"stderr": null,
"stderr_hash": null,
"returncode": 0
}
45 changes: 45 additions & 0 deletions tests/reference/llvm-structs_11-09fea6a.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
; ModuleID = 'LFortran'
source_filename = "LFortran"

%Bar = type { %Foo }
%Foo = type { i32 }

@bar = global %Bar zeroinitializer
@0 = private unnamed_addr constant [2 x i8] c" \00", align 1
@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@2 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1
@3 = private unnamed_addr constant [2 x i8] c" \00", align 1
@4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@5 = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1

define void @__module___main_____main__global_init() {
.entry:
br label %return

return: ; preds = %.entry
ret void
}

define void @__module___main_____main__global_stmts() {
.entry:
%0 = load i32, i32* getelementptr inbounds (%Bar, %Bar* @bar, i32 0, i32 0, i32 0), align 4
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @2, i32 0, i32 0), i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0))
%1 = load i32, i32* getelementptr inbounds (%Bar, %Bar* @bar, i32 0, i32 0, i32 0), align 4
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0))
br label %return

return: ; preds = %.entry
ret void
}

declare void @_lfortran_printf(i8*, ...)

define i32 @main(i32 %0, i8** %1) {
.entry:
call void @_lpython_set_argv(i32 %0, i8** %1)
call void @__module___main_____main__global_init()
call void @__module___main_____main__global_stmts()
ret i32 0
}

declare void @_lpython_set_argv(i32, i8**)
13 changes: 0 additions & 13 deletions tests/reference/llvm-structs_11-a746e1b.json

This file was deleted.

5 changes: 0 additions & 5 deletions tests/reference/llvm-structs_11-a746e1b.stderr

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ filename = "errors/structs_10.py"
asr = true

[[test]]
filename = "errors/structs_11.py"
filename = "structs_11.py"
llvm = true

[[test]]
Expand Down

0 comments on commit e10fd99

Please sign in to comment.