xref: /llvm-project/llvm/test/DebugInfo/AArch64/fallthrough-branch.ll (revision 3a05e01d1a76984fe1532bd237edbbb7ed9db6ea)
1; RUN: llc -O0 -stop-before=livedebugvalues < %s | FileCheck %s
2
3; ModuleID = '/tmp/t.o'
4source_filename = "/tmp/t.o"
5target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6target triple = "arm64-apple-macosx11.0.0"
7
8define swiftcc void @"$s1t1f1bySb_tF"(i1 %0) !dbg !35 {
9  %2 = alloca i1, align 8
10  %3 = bitcast ptr %2 to ptr
11  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 1, i1 false)
12  store i1 %0, ptr %2, align 8, !dbg !37
13; CHECK:   B %[[BB4:bb\.[0-9]+]], debug-location !{{[0-9]+}}
14  br i1 %0, label %4, label %5, !dbg !38
15
164:                                                ; preds = %1
17; CHECK:   [[BB4]]
18; Check that at -O0 the branches and their debug locations are not eliminated.
19; CHECK:   B %[[BB6:bb\.[0-9]+]], debug-location !{{[0-9]+}}
20  br label %6, !dbg !39
21
225:                                                ; preds = %1
23; CHECK:   B %[[BB6]], debug-location !{{[0-9]+}}
24  br label %6, !dbg !40
25
266:                                                ; preds = %4, %5
27  ret void, !dbg !39
28}
29
30; Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
31declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1
32attributes #1 = { argmemonly nofree nosync nounwind willreturn writeonly }
33
34!llvm.module.flags = !{!6, !7, !14}
35!llvm.dbg.cu = !{!15, !27}
36
37!6 = !{i32 7, !"Dwarf Version", i32 4}
38!7 = !{i32 2, !"Debug Info Version", i32 3}
39!14 = !{i32 1, !"Swift Version", i32 7}
40!15 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !16, producer: "Swift", emissionKind: LineTablesOnly)
41!16 = !DIFile(filename: "t.swift", directory: "/tmp")
42!17 = !{}
43!27 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !16, emissionKind: LineTablesOnly)
44!35 = distinct !DISubprogram(name: "f", linkageName: "$s1t1f1bySb_tF", scope: !15, file: !16, line: 1, type: !36, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !17)
45!36 = !DISubroutineType(types: null)
46!37 = !DILocation(line: 0, scope: !35)
47!38 = !DILocation(line: 2, column: 9, scope: !35)
48!39 = !DILocation(line: 3, column: 1, scope: !35)
49!40 = !DILocation(line: 2, column: 18, scope: !35)
50