xref: /aosp_15_r20/external/llvm/test/Transforms/SimplifyCFG/trap-debugloc.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt -S -simplifycfg < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; Radar 9342286
3*9880d681SAndroid Build Coastguard Worker; Assign DebugLoc to trap instruction.
4*9880d681SAndroid Build Coastguard Workerdefine void @foo() nounwind ssp !dbg !0 {
5*9880d681SAndroid Build Coastguard Worker; CHECK: call void @llvm.trap(), !dbg
6*9880d681SAndroid Build Coastguard Worker  store i32 42, i32* null, !dbg !5
7*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !7
8*9880d681SAndroid Build Coastguard Worker}
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!2}
11*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!10}
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker!0 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !2, file: !8, scope: !1, type: !3)
14*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "foo.c", directory: "/private/tmp")
15*9880d681SAndroid Build Coastguard Worker!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-206.1) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: FullDebug, file: !8, enums: !{}, retainedTypes: !{})
16*9880d681SAndroid Build Coastguard Worker!3 = !DISubroutineType(types: !4)
17*9880d681SAndroid Build Coastguard Worker!4 = !{null}
18*9880d681SAndroid Build Coastguard Worker!5 = !DILocation(line: 4, column: 2, scope: !6)
19*9880d681SAndroid Build Coastguard Worker!6 = distinct !DILexicalBlock(line: 3, column: 12, file: !8, scope: !0)
20*9880d681SAndroid Build Coastguard Worker!7 = !DILocation(line: 5, column: 1, scope: !6)
21*9880d681SAndroid Build Coastguard Worker!8 = !DIFile(filename: "foo.c", directory: "/private/tmp")
22*9880d681SAndroid Build Coastguard Worker!10 = !{i32 1, !"Debug Info Version", i32 3}
23