1# This test checks to make sure that when an instruction (%3 in the test) is 2# moved due to matching a result of a fold of two other instructions 3# (%1, and %2 in the test) in the legalizer, the DILocation of the 4# instruction that is moved (%3) is updated appropriately. 5 6# RUN: llc %s -run-pass=legalizer -mtriple=aarch64 -o - | FileCheck %s 7# CHECK-NOT: %2:_(s32) = G_CONSTANT i32 0, debug-location !DILocation(line: 13 8# CHECK: %2:_(s32) = G_CONSTANT i32 0, debug-location !DILocation(line: 0, 9--- | 10 11 define i32 @main(i32 %0, ptr %1) #0 !dbg !57 { 12 entry: 13 ret i32 0, !dbg !71 14 } 15 !3 = !DIFile(filename: "main.swift", directory: "/Volumes/Data/swift") 16 !23 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !3, sdk: "blah.sdk") 17 !57 = distinct !DISubprogram(name: "main", unit: !23) 18 !64 = distinct !DILexicalBlock(scope: !57, column: 1) 19 !66 = distinct !DILexicalBlock(scope: !64, column: 1) 20 !68 = !DILocation(line: 12, scope: !66) 21 !70 = distinct !DILexicalBlock(scope: !66, column: 1) 22 !71 = !DILocation(line: 13, scope: !70) 23name: main 24body: | 25 bb.0: 26 %1:_(s8) = G_CONSTANT i8 0, debug-location !68 27 %2:_(s32) = G_ANYEXT %1(s8), debug-location !68 28 $w2 = COPY %2(s32), debug-location !68 29 %3:_(s32) = G_CONSTANT i32 0, debug-location !71 30 $w0 = COPY %3(s32), debug-location !71 31