47 lines · plain
1; RUN: opt -passes=annotation-remarks -o /dev/null -S -pass-remarks-output=%t.opt.yaml %s -pass-remarks-missed=annotation-remarks 2>&1 | FileCheck %s2; RUN: cat %t.opt.yaml | FileCheck -check-prefix=YAML %s3 4; No remarks for this function, no instructions with metadata.5define void @none() {6; YAML-NOT: Function: none7 ret void8}9 10; Emit a remark that reports an instruction we can't analyze.11define void @unknown() {12; CHECK: Initialization inserted by -ftrivial-auto-var-init.13; YAML-LABEL: --- !Missed14; YAML-NEXT: Pass: annotation-remarks15; YAML-NEXT: Name: AutoInitUnknownInstruction16; YAML-NEXT: DebugLoc:17; YAML-NEXT: Function: unknown18; YAML-NEXT: Args:19; YAML-NEXT: - String: Initialization inserted by -ftrivial-auto-var-init.20; YAML-NEXT: ...21 ret void, !annotation !0, !dbg !DILocation(scope: !4)22}23 24; Emit a remark that reports an intrinsic call to an unknown intrinsic.25define void @unknown_intrinsic(ptr %dst) {26; CHECK-NEXT: Initialization inserted by -ftrivial-auto-var-init.27; YAML-LABEL: --- !Missed28; YAML-NEXT: Pass: annotation-remarks29; YAML-NEXT: Name: AutoInitUnknownInstruction30; YAML-NEXT: DebugLoc:31; YAML-NEXT: Function: unknown_intrinsic32 call ptr @llvm.returnaddress(i32 0), !annotation !0, !dbg !DILocation(scope: !4)33 ret void34}35 36declare ptr @llvm.returnaddress(i32) nounwind readnone37 38!llvm.module.flags = !{!1}39!0 = !{ !"auto-init" }40!1 = !{i32 2, !"Debug Info Version", i32 3}41!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3)42!3 = !DIFile(filename: "file", directory: "")43!4 = distinct !DISubprogram(name: "function", scope: !3, file: !3, unit: !2)44!5 = !DIBasicType(name: "byte", size: 8)45!6 = !DILocalVariable(name: "destination", scope: !4, file: !3, type: !5)46!7 = !DILocalVariable(name: "destination2", scope: !4, file: !3, type: !5)47