xref: /llvm-project/llvm/test/Transforms/Util/trivial-auto-var-init-crash-20210521.ll (revision e26017d4c5a5871e75f56140b5d47da483cf8f25)
1; RUN: opt -passes=annotation-remarks -pass-remarks-missed=annotation-remarks -disable-output < %s 2>&1 | FileCheck %s
2
3; ModuleID = 'bugpoint-reduced-simplified.bc'
4source_filename = "test.ll"
5target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6target triple = "arm64-apple-ios14.4.0"
7
8%struct.frop = type { ptr }
9
10; Function Attrs: argmemonly nofree nosync nounwind willreturn
11declare void @llvm.memset.p0.i64(ptr noalias nocapture writeonly, i8, i64, i1 immarg) #0
12
13define void @spam() local_unnamed_addr #1 !dbg !3 {
14bb:
15  call void @llvm.dbg.value(metadata ptr null, metadata !21, metadata !DIExpression()) #3, !dbg !28
16
17; CHECK: remark: :1:0: Call to memset inserted by -ftrivial-auto-var-init. Memory operation size: 0 bytes.
18  tail call void @llvm.memset.p0.i64(ptr null, i8 0, i64 0, i1 false), !annotation !33, !dbg !28
19  ret void
20}
21
22; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
23declare void @llvm.dbg.value(metadata, metadata, metadata) #2
24
25attributes #0 = { argmemonly nofree nosync nounwind willreturn }
26attributes #1 = { "target-features"="+aes,+crypto,+fp-armv8,+neon,+sha2,+zcm,+zcz" }
27attributes #2 = { nofree nosync nounwind readnone speculatable willreturn }
28attributes #3 = { nounwind }
29
30!llvm.module.flags = !{!0}
31!llvm.dbg.cu = !{!1}
32
33!0 = !{i32 2, !"Debug Info Version", i32 3}
34!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
35!2 = !DIFile(filename: "frop.c", directory: "frop")
36!3 = distinct !DISubprogram(scope: !4, file: !4, line: 1, type: !5, scopeLine: 2167, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !1, retainedNodes: !19)
37!4 = !DIFile(filename: "", directory: "frop")
38!5 = !DISubroutineType(types: !6)
39!6 = !{!7}
40!7 = !DIDerivedType(tag: DW_TAG_typedef, file: !4, line: 1, baseType: !8)
41!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64)
42!9 = distinct !DICompositeType(tag: DW_TAG_union_type, file: !4, line: 1, size: 1664, elements: !10)
43!10 = !{!11}
44!11 = !DIDerivedType(tag: DW_TAG_member, scope: !12, file: !4, line: 1, baseType: !16, size: 192)
45!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !4, line: 1, size: 832, elements: !13)
46!13 = !{!14}
47!14 = !DIDerivedType(tag: DW_TAG_member, scope: !12, file: !4, line: 1, baseType: !15, size: 448)
48!15 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !4, line: 1, size: 448, elements: !10)
49!16 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !4, line: 1, size: 192, elements: !17)
50!17 = !{!18}
51!18 = !DIDerivedType(tag: DW_TAG_member, scope: !12, file: !4, line: 1, baseType: !7, size: 64)
52!19 = !{!20}
53!20 = !DILocalVariable(arg: 1, scope: !3, file: !4, line: 1, type: !7)
54!21 = !DILocalVariable(arg: 2, scope: !22, file: !4, line: 1, type: !7)
55!22 = distinct !DISubprogram(scope: !4, file: !4, line: 1, type: !23, scopeLine: 1381, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !1, retainedNodes: !26)
56!23 = !DISubroutineType(types: !24)
57!24 = !{!25}
58!25 = !DIBasicType(size: 32, encoding: DW_ATE_signed)
59!26 = !{!27}
60!27 = !DILocalVariable(arg: 1, scope: !22, file: !4, line: 1, type: !7)
61!28 = !DILocation(line: 1, scope: !22, inlinedAt: !29)
62!29 = distinct !DILocation(line: 1, scope: !30)
63!30 = distinct !DILexicalBlock(scope: !31, file: !4, line: 1)
64!31 = distinct !DILexicalBlock(scope: !32, file: !4, line: 1)
65!32 = distinct !DILexicalBlock(scope: !3, file: !4, line: 1)
66
67
68!33 = !{ !"auto-init" }
69