File: run_dbg-runtime_stacktrace_01-dcc746e.stdout

package info (click to toggle)
lfortran 0.58.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 54,512 kB
  • sloc: cpp: 162,179; f90: 68,251; python: 17,476; ansic: 6,278; yacc: 2,334; sh: 1,317; fortran: 892; makefile: 33; javascript: 15
file content (164 lines) | stat: -rw-r--r-- 8,725 bytes parent folder | download | duplicates (2)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
; ModuleID = 'LFortran'
source_filename = "LFortran"

%string_descriptor = type <{ i8*, i64 }>

@0 = private unnamed_addr constant [39 x i8] c"tests/errors/runtime_stacktrace_01.f90\00", align 1
@STOP = private unnamed_addr constant [5 x i8] c"STOP\00", align 1
@1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@2 = private unnamed_addr constant [8 x i8] c"%s %d%s\00", align 1
@3 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1
@4 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@5 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1
@6 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define i32 @main(i32 %0, i8** %1) !dbg !3 {
.entry:
  call void @_lpython_call_initial_functions(i32 %0, i8** %1), !dbg !7
  %2 = alloca i64, align 8, !dbg !7
  %3 = call i32 @_xx_lcompilers_changed_main_xx(), !dbg !9
  %4 = alloca i32, align 4, !dbg !9
  store i32 %3, i32* %4, align 4, !dbg !9
  %5 = call i8* (i8*, i64, i8*, i64*, 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), i64* %2, i32 0, i32 0, i32* %4), !dbg !9
  %6 = load i64, i64* %2, align 4, !dbg !9
  %stringFormat_desc = alloca %string_descriptor, align 8, !dbg !9
  %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0, !dbg !9
  store i8* %5, i8** %7, align 8, !dbg !9
  %8 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1, !dbg !9
  store i64 %6, i64* %8, align 4, !dbg !9
  %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0, !dbg !9
  %10 = load i8*, i8** %9, align 8, !dbg !9
  %11 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1, !dbg !9
  %12 = load i64, i64* %11, align 4, !dbg !9
  %13 = trunc i64 %12 to i32, !dbg !9
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @6, i32 0, i32 0), i8* %10, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @5, i32 0, i32 0), i32 1), !dbg !9
  call void @_lfortran_free(i8* %5), !dbg !9
  call void @_lpython_free_argv(), !dbg !9
  br label %return, !dbg !9

return:                                           ; preds = %.entry
  ret i32 0, !dbg !9
}

define void @f() !dbg !10 {
.entry:
  br i1 true, label %then, label %else, !dbg !13

then:                                             ; preds = %.entry
  call void (i8*, i1, ...) @print_stacktrace_addresses(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @0, i32 0, i32 0), i1 false), !dbg !13
  br label %ifcont, !dbg !13

else:                                             ; preds = %.entry
  br label %ifcont, !dbg !13

ifcont:                                           ; preds = %else, %then
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @STOP, i32 0, i32 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @1, i32 0, i32 0)), !dbg !13
  call void @exit(i32 1), !dbg !13
  br label %return, !dbg !13

return:                                           ; preds = %ifcont
  ret void, !dbg !13
}

define i32 @g() !dbg !14 {
.entry:
  %g = alloca i32, align 4, !dbg !15
  call void @llvm.dbg.declare(metadata i32* %g, metadata !16, metadata !DIExpression()), !dbg !17
  store i32 1, i32* %g, align 4, !dbg !18
  call void @f(), !dbg !19
  br label %return, !dbg !19

return:                                           ; preds = %.entry
  %0 = load i32, i32* %g, align 4, !dbg !19
  ret i32 %0, !dbg !19
}

define i32 @_xx_lcompilers_changed_main_xx() !dbg !8 {
.entry:
  %main = alloca i32, align 4, !dbg !20
  call void @llvm.dbg.declare(metadata i32* %main, metadata !21, metadata !DIExpression()), !dbg !22
  store i32 1, i32* %main, align 4, !dbg !23
  %0 = alloca i64, align 8, !dbg !23
  %1 = call i32 @g(), !dbg !24
  %2 = alloca i32, align 4, !dbg !24
  store i32 %1, i32* %2, align 4, !dbg !24
  %3 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %0, i32 0, i32 0, i32* %2), !dbg !24
  %4 = load i64, i64* %0, align 4, !dbg !24
  %stringFormat_desc = alloca %string_descriptor, align 8, !dbg !24
  %5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0, !dbg !24
  store i8* %3, i8** %5, align 8, !dbg !24
  %6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1, !dbg !24
  store i64 %4, i64* %6, align 4, !dbg !24
  %7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0, !dbg !24
  %8 = load i8*, i8** %7, align 8, !dbg !24
  %9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1, !dbg !24
  %10 = load i64, i64* %9, align 4, !dbg !24
  %11 = trunc i64 %10 to i32, !dbg !24
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @4, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @3, i32 0, i32 0), i32 1), !dbg !24
  call void @_lfortran_free(i8* %3), !dbg !24
  br label %return, !dbg !24

return:                                           ; preds = %.entry
  %12 = load i32, i32* %main, align 4, !dbg !24
  ret i32 %12, !dbg !24
}

declare void @print_stacktrace_addresses(i8*, i1, ...)

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

declare void @exit(i32)

; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0

declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...)

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

declare void @_lfortran_free(i8*)

declare void @_lpython_call_initial_functions(i32, i8**)

declare void @_lpython_free_argv()

attributes #0 = { nounwind readnone speculatable willreturn }

!llvm.dbg.cu = !{!0}

!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "LPython Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "tests/errors/runtime_stacktrace_01.f90", directory: ".")
!2 = !{}
!3 = distinct !DISubprogram(name: "expr2", scope: !1, file: !1, line: 1, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
!4 = !DISubroutineType(types: !5)
!5 = !{!6}
!6 = !DIBasicType(name: "integer", size: 32, encoding: DW_ATE_signed)
!7 = !DILocation(line: 1, column: 1, scope: !8)
!8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
!9 = !DILocation(line: 3, column: 14, scope: !8)
!10 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 13, type: !11, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
!11 = !DISubroutineType(types: !12)
!12 = !{null}
!13 = !DILocation(line: 14, column: 9, scope: !10)
!14 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 17, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
!15 = !DILocation(line: 17, column: 5, scope: !14)
!16 = !DILocalVariable(name: "g", arg: 1, scope: !14, file: !1, line: 18, type: !6)
!17 = !DILocation(line: 18, scope: !14)
!18 = !DILocation(line: 19, column: 9, scope: !14)
!19 = !DILocation(line: 20, column: 9, scope: !14)
!20 = !DILocation(line: 7, column: 5, scope: !8)
!21 = !DILocalVariable(name: "main", arg: 1, scope: !8, file: !1, line: 8, type: !6)
!22 = !DILocation(line: 8, scope: !8)
!23 = !DILocation(line: 9, column: 9, scope: !8)
!24 = !DILocation(line: 10, column: 18, scope: !8)
asr_to_llvm: module failed verification. Error:
!dbg attachment points at wrong subprogram for function
!3 = distinct !DISubprogram(name: "expr2", scope: !1, file: !1, line: 1, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
i32 (i32, i8**)* @main
  call void @_lpython_call_initial_functions(i32 %0, i8** %1), !dbg !7
!7 = !DILocation(line: 1, column: 1, scope: !8)
!8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
!8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)