File: verifier-invalid-disubprogram.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (79 lines) | stat: -rw-r--r-- 3,213 bytes parent folder | download | duplicates (9)
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
; RUN: llvm-as -disable-output %s 2>&1 | FileCheck --match-full-lines %s

!llvm.module.flags = !{!2}
!llvm.dbg.cu = !{!0}
!0 = distinct !DICompileUnit(language: 0, file: !1)
!1 = !DIFile(filename: "-", directory: "")
!2 = !{i32 2, !"Debug Info Version", i32 3}

; CHECK: invalid file
define void @invalid_file() !dbg !3 { ret void }
!3 = distinct !DISubprogram(file: !0)

; CHECK: line specified with no file
define void @line_specified_with_no_file() !dbg !4 { ret void }
!4 = distinct !DISubprogram(line: 1)

; CHECK: invalid subroutine type
define void @invalid_subroutine_type() !dbg !5 { ret void }
!5 = distinct !DISubprogram(type: !0)

; CHECK: invalid containing type
define void @invalid_containing_type() !dbg !6 { ret void }
!6 = distinct !DISubprogram(containingType: !0)

; CHECK: invalid template params
define void @invalid_template_params() !dbg !7 { ret void }
!7 = distinct !DISubprogram(templateParams: !0)

; CHECK: invalid template parameter
define void @invalid_template_parameter() !dbg !8 { ret void }
!8 = distinct !DISubprogram(templateParams: !{!0})

; CHECK: invalid subprogram declaration
define void @invalid_subprogram_declaration() !dbg !9 { ret void }
!9 = distinct !DISubprogram(declaration: !0)

; CHECK: invalid retained nodes list
define void @invalid_retained_nodes_list() !dbg !10 { ret void }
!10 = distinct !DISubprogram(retainedNodes: !0)

; CHECK: invalid retained nodes, expected DILocalVariable or DILabel
define void @invalid_retained_nodes_expected() !dbg !11 { ret void }
!11 = distinct !DISubprogram(retainedNodes: !{!0})

; CHECK: invalid reference flags
define void @invalid_reference_flags_reference() !dbg !12 { ret void }
!12 = distinct !DISubprogram(flags: DIFlagLValueReference | DIFlagRValueReference)

; CHECK: invalid reference flags
define void @invalid_reference_flags_pass_by() !dbg !13 { ret void }
!13 = distinct !DISubprogram(flags: DIFlagTypePassByValue | DIFlagTypePassByReference)

; CHECK: subprogram definitions must have a compile unit
define void @subprogram_definitions_must_have_a_compile_unit() !dbg !14 { ret void }
!14 = distinct !DISubprogram()

; CHECK: invalid unit type
define void @invalid_unit_type() !dbg !15 { ret void }
!15 = distinct !DISubprogram(unit: !{})

; FIXME: should something verify `isDefinition` is not a lie? is it meaningful
; to mistmatch it with respect to the LLVM IR function?
; CHECK: subprogram declarations must not have a compile unit
define void @subprogram_declarations_must_not_have_a_compile_unit() !dbg !16 { ret void }
!16 = distinct !DISubprogram(isDefinition: false, unit: !0)

; CHECK: invalid thrown types list
define void @invalid_thrown_types_list() !dbg !17 { ret void }
!17 = distinct !DISubprogram(isDefinition: false, thrownTypes: !0)

; CHECK: invalid thrown type
define void @invalid_thrown_type() !dbg !18 { ret void }
!18 = distinct !DISubprogram(isDefinition: false, thrownTypes: !{!0})

; CHECK: DIFlagAllCallsDescribed must be attached to a definition
define void @DIFlagAllCallsDescribed_must_be_attached_to_a_definition() !dbg !19 { ret void }
!19 = distinct !DISubprogram(isDefinition: false, flags: DIFlagAllCallsDescribed)

; CHECK: warning: ignoring invalid debug info{{.*}}