1 # RUN: llc %s -o - -run-pass=early-tailduplication | FileCheck %s --check-prefixes=CHECK,DEBUG
2 # RUN: llc %s -o - -run-pass=mir-strip-debug,early-tailduplication -mir-strip-debugify-only=0 | FileCheck %s --check-prefix=CHECK
4 # We should get the same result with and without debug information.
5 # Specifically, the register class of [[COPY]] should not be changed to
6 # gpr32common with debug info while staying as gpr32sp without.
9 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
10 target triple = "aarch64-none-linux-gnu"
12 define void @test() !dbg !8 {
18 !llvm.module.flags = !{!2, !3, !4, !5}
21 !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "My compiler", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
22 !1 = !DIFile(filename: "foo.c", directory: "/bar")
23 !2 = !{i32 7, !"Dwarf Version", i32 4}
24 !3 = !{i32 2, !"Debug Info Version", i32 3}
25 !4 = !{i32 1, !"wchar_size", i32 1}
26 !5 = !{i32 7, !"frame-pointer", i32 2}
27 !6 = !{!"My compiler"}
28 !7 = !DILocalVariable(name: "i", scope: !8, file: !1, line: 6, type: !12)
29 !8 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 5, type: !9, scopeLine: 5, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)
30 !9 = !DISubroutineType(types: !10)
33 !12 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
34 !13 = !DILocation(line: 0, scope: !8)
38 tracksRegLiveness: true
41 ; CHECK-LABEL: name: test
43 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
44 ; CHECK-NEXT: liveins: $w0, $wzr
46 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
47 ; CHECK-NEXT: CBNZW $wzr, %bb.2
50 ; CHECK-NEXT: successors: %bb.4(0x80000000)
52 ; CHECK-NEXT: $x0 = COPY undef $x0
53 ; DEBUG-NEXT: DBG_VALUE [[COPY]], $noreg, !11, !DIExpression(), debug-location !DILocation(line: 0, scope: !7)
54 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]]
58 ; CHECK-NEXT: successors: %bb.4(0x80000000)
60 ; DEBUG-NEXT: DBG_VALUE [[COPY]], $noreg, !11, !DIExpression(), debug-location !DILocation(line: 0, scope: !7)
61 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr32 = COPY [[COPY]]
64 ; CHECK-NEXT: RET undef $lr, implicit undef $w0
66 successors: %bb.2, %bb.1
84 %2:gpr32 = PHI %1, %bb.1, %1, %bb.2
85 DBG_VALUE %2, $noreg, !7, !DIExpression(), debug-location !13
89 RET undef $lr, implicit undef $w0