Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b858edb

Browse files
committed
Update references
1 parent 2d586ef commit b858edb

8 files changed

+146
-24
lines changed

tests/reference/asr-bindc_01-6d521a9.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "asr-bindc_01-6d521a9",
33
"cmd": "lpython --show-asr --no-color {infile} -o {outfile}",
44
"infile": "tests/../integration_tests/bindc_01.py",
5-
"infile_hash": "f628ce81b32f2730f936232bb235f39d4372912bc332f3c97e983ad7",
5+
"infile_hash": "4a4dbf4bd341ab197e648f5cbc66bfc49d87efcae7eaed047b002eb5",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-bindc_01-6d521a9.stdout",
9-
"stdout_hash": "c1c5afabc9ecb18c731ad21825ee23c181c1965e4acf5fd2776b2008",
9+
"stdout_hash": "62629184ea444de549e9ad92da90c7f1c37861076a22e47704676527",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-bindc_01-6d521a9.stdout

Lines changed: 89 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
_global_symbols:
66
(Module
77
(SymbolTable
8-
4
8+
5
99
{
1010
_lpython_main_program:
1111
(Function
1212
(SymbolTable
13-
3
13+
4
1414
{
1515

1616
})
@@ -30,18 +30,24 @@
3030
[]
3131
.false.
3232
)
33-
[]
33+
[test_issue_1781]
3434
[]
3535
[(CPtrToPointer
36-
(Var 4 queries)
37-
(Var 4 x)
36+
(Var 5 queries)
37+
(Var 5 x)
3838
()
3939
)
4040
(Print
4141
()
42-
[(Var 4 queries)
43-
(Var 4 x)]
42+
[(Var 5 queries)
43+
(Var 5 x)]
44+
()
4445
()
46+
)
47+
(SubroutineCall
48+
5 test_issue_1781
49+
()
50+
[]
4551
()
4652
)]
4753
()
@@ -52,22 +58,90 @@
5258
),
5359
queries:
5460
(Variable
55-
4
61+
5
5662
queries
5763
[]
5864
Local
59-
()
60-
()
65+
(PointerNullConstant
66+
(CPtr)
67+
)
68+
(PointerNullConstant
69+
(CPtr)
70+
)
6171
Default
6272
(CPtr)
6373
Source
6474
Public
6575
Required
6676
.false.
6777
),
78+
test_issue_1781:
79+
(Function
80+
(SymbolTable
81+
2
82+
{
83+
p:
84+
(Variable
85+
2
86+
p
87+
[]
88+
Local
89+
()
90+
()
91+
Default
92+
(CPtr)
93+
Source
94+
Public
95+
Required
96+
.false.
97+
)
98+
})
99+
test_issue_1781
100+
(FunctionType
101+
[]
102+
()
103+
Source
104+
Implementation
105+
()
106+
.false.
107+
.false.
108+
.false.
109+
.false.
110+
.false.
111+
[]
112+
[]
113+
.false.
114+
)
115+
[]
116+
[]
117+
[(=
118+
(Var 2 p)
119+
(PointerNullConstant
120+
(CPtr)
121+
)
122+
()
123+
)
124+
(Assert
125+
(CPtrCompare
126+
(Var 2 p)
127+
Eq
128+
(PointerNullConstant
129+
(CPtr)
130+
)
131+
(Logical 4 [])
132+
()
133+
)
134+
()
135+
)]
136+
()
137+
Public
138+
.false.
139+
.false.
140+
()
141+
),
68142
x:
69143
(Variable
70-
4
144+
5
71145
x
72146
[]
73147
Local
@@ -91,13 +165,13 @@
91165
main_program:
92166
(Program
93167
(SymbolTable
94-
2
168+
3
95169
{
96170
_lpython_main_program:
97171
(ExternalSymbol
98-
2
172+
3
99173
_lpython_main_program
100-
4 _lpython_main_program
174+
5 _lpython_main_program
101175
_global_symbols
102176
[]
103177
_lpython_main_program
@@ -107,7 +181,7 @@
107181
main_program
108182
[_global_symbols]
109183
[(SubroutineCall
110-
2 _lpython_main_program
184+
3 _lpython_main_program
111185
()
112186
[]
113187
()

tests/reference/asr-bindc_02-bc1a7ea.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-bindc_02-bc1a7ea.stdout",
9-
"stdout_hash": "a48a2ddd1469559be941968442243d048382d13bccf878ab3dd788d7",
9+
"stdout_hash": "a74aa56cff206d4ef8fb0766f1cf596c122255882a7df3f5e4fcf4e7",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-bindc_02-bc1a7ea.stdout

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@
130130
[]
131131
[]
132132
[(=
133+
(Var 193 yq)
134+
(PointerNullConstant
135+
(CPtr)
136+
)
137+
()
138+
)
139+
(=
133140
(ArrayItem
134141
(Var 193 y)
135142
[(()
@@ -284,8 +291,12 @@
284291
queries
285292
[]
286293
Local
287-
()
288-
()
294+
(PointerNullConstant
295+
(CPtr)
296+
)
297+
(PointerNullConstant
298+
(CPtr)
299+
)
289300
Default
290301
(CPtr)
291302
Source

tests/reference/asr-structs_02-2ab459a.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "asr-structs_02-2ab459a.stdout",
9-
"stdout_hash": "f56302bba116e03b67d1812db40060ab8017dd5ce79b2bdff7baf644",
9+
"stdout_hash": "ae8e8d2163b51eb20e19e6257618899aa4fbe78452e760a38608651d",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/asr-structs_02-2ab459a.stdout

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,14 @@
368368
)
369369
[f]
370370
[]
371-
[(SubroutineCall
371+
[(=
372+
(Var 4 b)
373+
(PointerNullConstant
374+
(CPtr)
375+
)
376+
()
377+
)
378+
(SubroutineCall
372379
7 f
373380
()
374381
[((Var 4 b))]

tests/reference/llvm-bindc_01-c984f09.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "llvm-bindc_01-c984f09",
33
"cmd": "lpython --no-color --show-llvm {infile} -o {outfile}",
44
"infile": "tests/../integration_tests/bindc_01.py",
5-
"infile_hash": "f628ce81b32f2730f936232bb235f39d4372912bc332f3c97e983ad7",
5+
"infile_hash": "4a4dbf4bd341ab197e648f5cbc66bfc49d87efcae7eaed047b002eb5",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "llvm-bindc_01-c984f09.stdout",
9-
"stdout_hash": "7e1b82f490b9a95ea81f4754694a725b89f16080d738e77e35462e9f",
9+
"stdout_hash": "11b95423195015653cffd81f8014d33dc5d96ab4cf35ecbfa16a583c",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/llvm-bindc_01-c984f09.stdout

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ source_filename = "LFortran"
66
@0 = private unnamed_addr constant [2 x i8] c" \00", align 1
77
@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
88
@2 = private unnamed_addr constant [13 x i8] c"%lld%s%lld%s\00", align 1
9+
@3 = private unnamed_addr constant [16 x i8] c"AssertionError\0A\00", align 1
910

1011
define void @__module__global_symbols__lpython_main_program() {
1112
.entry:
@@ -17,14 +18,43 @@ define void @__module__global_symbols__lpython_main_program() {
1718
%4 = load i16*, i16** @x, align 8
1819
%5 = ptrtoint i16* %4 to i64
1920
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @2, i32 0, i32 0), i64 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i64 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0))
21+
call void @__module__global_symbols_test_issue_1781()
2022
br label %return
2123

2224
return: ; preds = %.entry
2325
ret void
2426
}
2527

28+
define void @__module__global_symbols_test_issue_1781() {
29+
.entry:
30+
%p = alloca void*, align 8
31+
store void* null, void** %p, align 8
32+
%0 = load void*, void** %p, align 8
33+
%1 = ptrtoint void* %0 to i64
34+
%2 = icmp eq i64 %1, 0
35+
br i1 %2, label %then, label %else
36+
37+
then: ; preds = %.entry
38+
br label %ifcont
39+
40+
else: ; preds = %.entry
41+
call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @3, i32 0, i32 0))
42+
call void @exit(i32 1)
43+
br label %ifcont
44+
45+
ifcont: ; preds = %else, %then
46+
br label %return
47+
48+
return: ; preds = %ifcont
49+
ret void
50+
}
51+
2652
declare void @_lfortran_printf(i8*, ...)
2753

54+
declare void @_lcompilers_print_error(i8*, ...)
55+
56+
declare void @exit(i32)
57+
2858
define i32 @main(i32 %0, i8** %1) {
2959
.entry:
3060
call void @_lpython_set_argv(i32 %0, i8** %1)

0 commit comments

Comments
 (0)