Skip to content

Commit e4f74fb

Browse files
committed
Updated tests
1 parent 8ab7607 commit e4f74fb

10 files changed

+119
-86
lines changed

tests/reference/llvm-bool1-af4376b.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": "llvm-bool1-af4376b.stdout",
9-
"stdout_hash": "8aae811b5de879e2113d72dec8c276c6470c6c2ce5f241e45922110f",
9+
"stdout_hash": "db97f976e5422118e04265a15db4584c1c743a50fb46a6d1f2083557",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/llvm-bool1-af4376b.stdout

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,44 +40,56 @@ define void @__module___main___test_bool() {
4040
store i64 %2, i64* %5, align 4
4141
%6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
4242
%7 = load i8*, i8** %6, align 8
43-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
44-
%8 = alloca i1, align 1
45-
store i1 false, i1* %8, align 1
46-
%9 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info.1, i32 0, i32 0), i32 0, i32 0, i1* %8)
47-
%10 = call i64 @_lfortran_str_len(i8* %9)
48-
%11 = call i8* @_lfortran_malloc(i64 16)
49-
%stringFormat_desc1 = bitcast i8* %11 to %string_descriptor*
50-
%12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
51-
store i8* %9, i8** %12, align 8
52-
%13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1
53-
store i64 %10, i64* %13, align 4
54-
%14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
55-
%15 = load i8*, i8** %14, align 8
56-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0))
43+
%8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
44+
%9 = load i64, i64* %8, align 4
45+
%10 = trunc i64 %9 to i32
46+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
47+
%11 = alloca i1, align 1
48+
store i1 false, i1* %11, align 1
49+
%12 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info.1, i32 0, i32 0), i32 0, i32 0, i1* %11)
50+
%13 = call i64 @_lfortran_str_len(i8* %12)
51+
%14 = call i8* @_lfortran_malloc(i64 16)
52+
%stringFormat_desc1 = bitcast i8* %14 to %string_descriptor*
53+
%15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
54+
store i8* %12, i8** %15, align 8
55+
%16 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1
56+
store i64 %13, i64* %16, align 4
57+
%17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
58+
%18 = load i8*, i8** %17, align 8
59+
%19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1
60+
%20 = load i64, i64* %19, align 4
61+
%21 = trunc i64 %20 to i32
62+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %18, i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
5763
store i1 true, i1* %b, align 1
58-
%16 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info.2, i32 0, i32 0), i32 0, i32 0, i1* %b)
59-
%17 = call i64 @_lfortran_str_len(i8* %16)
60-
%18 = call i8* @_lfortran_malloc(i64 16)
61-
%stringFormat_desc2 = bitcast i8* %18 to %string_descriptor*
62-
%19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0
63-
store i8* %16, i8** %19, align 8
64-
%20 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1
65-
store i64 %17, i64* %20, align 4
66-
%21 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0
67-
%22 = load i8*, i8** %21, align 8
68-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0))
64+
%22 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info.2, i32 0, i32 0), i32 0, i32 0, i1* %b)
65+
%23 = call i64 @_lfortran_str_len(i8* %22)
66+
%24 = call i8* @_lfortran_malloc(i64 16)
67+
%stringFormat_desc2 = bitcast i8* %24 to %string_descriptor*
68+
%25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0
69+
store i8* %22, i8** %25, align 8
70+
%26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1
71+
store i64 %23, i64* %26, align 4
72+
%27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0
73+
%28 = load i8*, i8** %27, align 8
74+
%29 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1
75+
%30 = load i64, i64* %29, align 4
76+
%31 = trunc i64 %30 to i32
77+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %28, i32 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1)
6978
store i1 false, i1* %b, align 1
70-
%23 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info.3, i32 0, i32 0), i32 0, i32 0, i1* %b)
71-
%24 = call i64 @_lfortran_str_len(i8* %23)
72-
%25 = call i8* @_lfortran_malloc(i64 16)
73-
%stringFormat_desc3 = bitcast i8* %25 to %string_descriptor*
74-
%26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 0
75-
store i8* %23, i8** %26, align 8
76-
%27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 1
77-
store i64 %24, i64* %27, align 4
78-
%28 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 0
79-
%29 = load i8*, i8** %28, align 8
80-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0))
79+
%32 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @serialization_info.3, i32 0, i32 0), i32 0, i32 0, i1* %b)
80+
%33 = call i64 @_lfortran_str_len(i8* %32)
81+
%34 = call i8* @_lfortran_malloc(i64 16)
82+
%stringFormat_desc3 = bitcast i8* %34 to %string_descriptor*
83+
%35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 0
84+
store i8* %32, i8** %35, align 8
85+
%36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 1
86+
store i64 %33, i64* %36, align 4
87+
%37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 0
88+
%38 = load i8*, i8** %37, align 8
89+
%39 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 1
90+
%40 = load i64, i64* %39, align 4
91+
%41 = trunc i64 %40 to i32
92+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %38, i32 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1)
8193
br label %return
8294

8395
return: ; preds = %.entry
@@ -90,7 +102,7 @@ declare i64 @_lfortran_str_len(i8*)
90102

91103
declare i8* @_lfortran_malloc(i64)
92104

93-
declare void @_lfortran_printf(i8*, ...)
105+
declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)
94106

95107
define i32 @main(i32 %0, i8** %1) {
96108
.entry:

tests/reference/llvm-expr_01-54467c1.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": "llvm-expr_01-54467c1.stdout",
9-
"stdout_hash": "7a8a61c496802ff1e3e6d7bfda05d98b49464b5a27286ad68cd7725a",
9+
"stdout_hash": "4104665dbc2cc0623dc9bda897966324fa1be40dabd9d52587a8a055",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/llvm-expr_01-54467c1.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ define void @__module___main___main0() {
3333
store i64 %1, i64* %4, align 4
3434
%5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
3535
%6 = load i8*, i8** %5, align 8
36-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
36+
%7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
37+
%8 = load i64, i64* %7, align 4
38+
%9 = trunc i64 %8 to i32
39+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
3740
br label %return
3841

3942
return: ; preds = %.entry
@@ -46,7 +49,7 @@ declare i64 @_lfortran_str_len(i8*)
4649

4750
declare i8* @_lfortran_malloc(i64)
4851

49-
declare void @_lfortran_printf(i8*, ...)
52+
declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)
5053

5154
define i32 @main(i32 %0, i8** %1) {
5255
.entry:

tests/reference/llvm-func_inline_01-2d4583a.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": "llvm-func_inline_01-2d4583a.stdout",
9-
"stdout_hash": "ca9f6685c2177461d5165099462be0a3255e5adf2cccd92d3c4ff06f",
9+
"stdout_hash": "1420c1b2a4acb3c46cb8fc6c9f57496e3bbe9d0fc0b92c1d4fbbccc4",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/llvm-func_inline_01-2d4583a.stdout

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ define void @__module___main____xx_lcompilers_changed_main_xx() {
7575
store i64 %2, i64* %5, align 4
7676
%6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
7777
%7 = load i8*, i8** %6, align 8
78-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
79-
%8 = load i64, i64* %ans, align 4
80-
%9 = icmp eq i64 %8, 102334155
81-
br i1 %9, label %then, label %else
78+
%8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
79+
%9 = load i64, i64* %8, align 4
80+
%10 = trunc i64 %9 to i32
81+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
82+
%11 = load i64, i64* %ans, align 4
83+
%12 = icmp eq i64 %11, 102334155
84+
br i1 %12, label %then, label %else
8285

8386
then: ; preds = %.entry
8487
br label %ifcont
@@ -101,7 +104,7 @@ declare i64 @_lfortran_str_len(i8*)
101104

102105
declare i8* @_lfortran_malloc(i64)
103106

104-
declare void @_lfortran_printf(i8*, ...)
107+
declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)
105108

106109
declare void @_lcompilers_print_error(i8*, ...)
107110

tests/reference/llvm-print_04-443a8d8.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": "llvm-print_04-443a8d8.stdout",
9-
"stdout_hash": "1b9b856748d5126c0766edb7cddbb99e28807f49fff4cf0512f9f544",
9+
"stdout_hash": "b58ccd267c17d25f38ebaba6e82c251e0206fb69e5d948c9660b2009",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/llvm-print_04-443a8d8.stdout

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,52 @@ define void @__module___main_____main__global_stmts() {
3232
store i64 %1, i64* %4, align 4
3333
%5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
3434
%6 = load i8*, i8** %5, align 8
35-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
36-
%7 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i32 0, i32 0, i32* @__module___main___x)
37-
%8 = call i64 @_lfortran_str_len(i8* %7)
38-
%9 = call i8* @_lfortran_malloc(i64 16)
39-
%stringFormat_desc1 = bitcast i8* %9 to %string_descriptor*
40-
%10 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
41-
store i8* %7, i8** %10, align 8
42-
%11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1
43-
store i64 %8, i64* %11, align 4
44-
%12 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
45-
%13 = load i8*, i8** %12, align 8
46-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0))
47-
%14 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i32 0, i32 0, i16* @__module___main___y)
48-
%15 = call i64 @_lfortran_str_len(i8* %14)
49-
%16 = call i8* @_lfortran_malloc(i64 16)
50-
%stringFormat_desc2 = bitcast i8* %16 to %string_descriptor*
51-
%17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0
52-
store i8* %14, i8** %17, align 8
53-
%18 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1
54-
store i64 %15, i64* %18, align 4
55-
%19 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0
56-
%20 = load i8*, i8** %19, align 8
57-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0))
58-
%21 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i32 0, i32 0, i8* @__module___main___z)
59-
%22 = call i64 @_lfortran_str_len(i8* %21)
60-
%23 = call i8* @_lfortran_malloc(i64 16)
61-
%stringFormat_desc3 = bitcast i8* %23 to %string_descriptor*
62-
%24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 0
63-
store i8* %21, i8** %24, align 8
64-
%25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 1
65-
store i64 %22, i64* %25, align 4
66-
%26 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 0
67-
%27 = load i8*, i8** %26, align 8
68-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0))
35+
%7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
36+
%8 = load i64, i64* %7, align 4
37+
%9 = trunc i64 %8 to i32
38+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
39+
%10 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i32 0, i32 0, i32* @__module___main___x)
40+
%11 = call i64 @_lfortran_str_len(i8* %10)
41+
%12 = call i8* @_lfortran_malloc(i64 16)
42+
%stringFormat_desc1 = bitcast i8* %12 to %string_descriptor*
43+
%13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
44+
store i8* %10, i8** %13, align 8
45+
%14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1
46+
store i64 %11, i64* %14, align 4
47+
%15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 0
48+
%16 = load i8*, i8** %15, align 8
49+
%17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc1, i32 0, i32 1
50+
%18 = load i64, i64* %17, align 4
51+
%19 = trunc i64 %18 to i32
52+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
53+
%20 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.2, i32 0, i32 0), i32 0, i32 0, i16* @__module___main___y)
54+
%21 = call i64 @_lfortran_str_len(i8* %20)
55+
%22 = call i8* @_lfortran_malloc(i64 16)
56+
%stringFormat_desc2 = bitcast i8* %22 to %string_descriptor*
57+
%23 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0
58+
store i8* %20, i8** %23, align 8
59+
%24 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1
60+
store i64 %21, i64* %24, align 4
61+
%25 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 0
62+
%26 = load i8*, i8** %25, align 8
63+
%27 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc2, i32 0, i32 1
64+
%28 = load i64, i64* %27, align 4
65+
%29 = trunc i64 %28 to i32
66+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* %26, i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0), i32 1)
67+
%30 = call i8* (i8*, i64, i8*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.3, i32 0, i32 0), i32 0, i32 0, i8* @__module___main___z)
68+
%31 = call i64 @_lfortran_str_len(i8* %30)
69+
%32 = call i8* @_lfortran_malloc(i64 16)
70+
%stringFormat_desc3 = bitcast i8* %32 to %string_descriptor*
71+
%33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 0
72+
store i8* %30, i8** %33, align 8
73+
%34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 1
74+
store i64 %31, i64* %34, align 4
75+
%35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 0
76+
%36 = load i8*, i8** %35, align 8
77+
%37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc3, i32 0, i32 1
78+
%38 = load i64, i64* %37, align 4
79+
%39 = trunc i64 %38 to i32
80+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %36, i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1)
6981
br label %return
7082

7183
return: ; preds = %.entry
@@ -78,7 +90,7 @@ declare i64 @_lfortran_str_len(i8*)
7890

7991
declare i8* @_lfortran_malloc(i64)
8092

81-
declare void @_lfortran_printf(i8*, ...)
93+
declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)
8294

8395
define i32 @main(i32 %0, i8** %1) {
8496
.entry:

tests/reference/llvm_dbg-expr_01-9fc5f30.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": "llvm_dbg-expr_01-9fc5f30.stdout",
9-
"stdout_hash": "6e01516f5a96c59ab1774893df716fe16880353e0ae48e1e980a1573",
9+
"stdout_hash": "ce81c6492000b5678f2bb2459f04dce5649328b6fb5a3de182e67c9c",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0

tests/reference/llvm_dbg-expr_01-9fc5f30.stdout

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ define void @__module___main___main0() !dbg !7 {
3737
store i64 %1, i64* %4, align 4, !dbg !21
3838
%5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0, !dbg !21
3939
%6 = load i8*, i8** %5, align 8, !dbg !21
40-
call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0)), !dbg !21
40+
%7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1, !dbg !21
41+
%8 = load i64, i64* %7, align 4, !dbg !21
42+
%9 = trunc i64 %8 to i32, !dbg !21
43+
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %6, i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1), !dbg !21
4144
br label %return, !dbg !21
4245

4346
return: ; preds = %.entry
@@ -53,7 +56,7 @@ declare i64 @_lfortran_str_len(i8*)
5356

5457
declare i8* @_lfortran_malloc(i64)
5558

56-
declare void @_lfortran_printf(i8*, ...)
59+
declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)
5760

5861
define i32 @main(i32 %0, i8** %1) !dbg !22 {
5962
.entry:

0 commit comments

Comments
 (0)