@@ -59,13 +59,15 @@ define void @unhandled_intrinsic() gc "example" {
59
59
60
60
; // -----
61
61
62
+ ; Check that debug intrinsics with an unsupported argument are dropped.
63
+
62
64
declare void @llvm.dbg.value (metadata , metadata , metadata )
63
65
64
66
; CHECK: import-failure.ll
65
- ; CHECK-SAME: warning: dropped intrinsic: call void @llvm.dbg.value(metadata !DIArgList(i64 %arg1 , i64 undef), metadata !3, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_constu, 1, DW_OP_mul, DW_OP_plus, DW_OP_stack_value)), !dbg !5
67
+ ; CHECK-SAME: warning: dropped intrinsic: call void @llvm.dbg.value(metadata !DIArgList(i64 %{{.*}} , i64 undef), metadata !3, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_constu, 1, DW_OP_mul, DW_OP_plus, DW_OP_stack_value))
66
68
; CHECK: import-failure.ll
67
- ; CHECK-SAME: warning: dropped intrinsic: call void @llvm.dbg.value(metadata !6, metadata !3, metadata !DIExpression()), !dbg !5
68
- define void @dropped_instruction (i64 %arg1 ) {
69
+ ; CHECK-SAME: warning: dropped intrinsic: call void @llvm.dbg.value(metadata !6, metadata !3, metadata !DIExpression())
70
+ define void @unsupported_argument (i64 %arg1 ) {
69
71
call void @llvm.dbg.value (metadata !DIArgList (i64 %arg1 , i64 undef ), metadata !3 , metadata !DIExpression (DW_OP_LLVM_arg, 0 , DW_OP_LLVM_arg, 1 , DW_OP_constu, 1 , DW_OP_mul, DW_OP_plus, DW_OP_stack_value)), !dbg !5
70
72
call void @llvm.dbg.value (metadata !6 , metadata !3 , metadata !DIExpression ()), !dbg !5
71
73
ret void
@@ -83,6 +85,38 @@ define void @dropped_instruction(i64 %arg1) {
83
85
84
86
; // -----
85
87
88
+ ; Check that debug intrinsics that depend on cyclic metadata are dropped.
89
+
90
+ declare void @llvm.dbg.value (metadata , metadata , metadata )
91
+
92
+ ; CHECK: import-failure.ll
93
+ ; CHECK-SAME: warning: dropped instruction: call void @llvm.dbg.label(metadata !{{.*}})
94
+ ; CHECK: import-failure.ll
95
+ ; CHECK-SAME: warning: dropped intrinsic: call void @llvm.dbg.value(metadata i64 %{{.*}}, metadata !3, metadata !DIExpression())
96
+ define void @cylic_metadata (i64 %arg1 ) {
97
+ call void @llvm.dbg.value (metadata i64 %arg1 , metadata !10 , metadata !DIExpression ()), !dbg !14
98
+ call void @llvm.dbg.label (metadata !13 ), !dbg !14
99
+ ret void
100
+ }
101
+
102
+ !llvm.dbg.cu = !{!1 }
103
+ !llvm.module.flags = !{!0 }
104
+ !0 = !{i32 2 , !"Debug Info Version" , i32 3 }
105
+ !1 = distinct !DICompileUnit (language: DW_LANG_C, file: !2 )
106
+ !2 = !DIFile (filename: "import-failure.ll" , directory: "/" )
107
+ !3 = !DICompositeType (tag: DW_TAG_array_type, size: 42 , baseType: !4 )
108
+ !4 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: !3 )
109
+ !5 = distinct !DISubprogram (name: "class_method" , scope: !2 , file: !2 , type: !6 , spFlags: DISPFlagDefinition, unit: !1 )
110
+ !6 = !DISubroutineType (types: !7 )
111
+ !7 = !{!3 }
112
+ !10 = !DILocalVariable (scope: !5 , name: "arg1" , file: !2 , line: 1 , arg: 1 , align: 64 );
113
+ !11 = !DILexicalBlock (scope: !5 )
114
+ !12 = !DILexicalBlockFile (scope: !11 , discriminator: 0 )
115
+ !13 = !DILabel (scope: !12 , name: "label" , file: !2 , line: 42 )
116
+ !14 = !DILocation (line: 1 , column: 2 , scope: !5 )
117
+
118
+ ; // -----
119
+
86
120
; global_dtors with non-null data fields cannot be represented in MLIR.
87
121
; CHECK: <unknown>
88
122
; CHECK-SAME: error: unhandled global variable: @llvm.global_dtors
0 commit comments