|
| 1 | +// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s |
| 2 | + |
| 3 | +llvm.func @test_phi_locations(%arg0: !llvm.ptr) { |
| 4 | + %0 = llvm.mlir.constant(1 : i64) : i64 loc(#loc1) |
| 5 | + %1 = llvm.mlir.constant(100 : i32) : i32 loc(#loc1) |
| 6 | + llvm.br ^bb1(%1, %0 : i32, i64) loc(#loc1) |
| 7 | +^bb1(%2: i32 loc(#loc2), %3: i64 loc(#loc3)): |
| 8 | + %4 = llvm.icmp "sgt" %3, %0 : i64 loc(#loc1) |
| 9 | + llvm.cond_br %4, ^bb2, ^bb1(%2, %3 : i32, i64) loc(#loc1) |
| 10 | +^bb2: |
| 11 | + llvm.return loc(#loc1) |
| 12 | +} loc(#loc4) |
| 13 | + |
| 14 | +#file = #llvm.di_file<"test.f90" in ""> |
| 15 | +#cu = #llvm.di_compile_unit<id = distinct[0]<>, |
| 16 | + sourceLanguage = DW_LANG_Fortran95, file = #file, isOptimized = false, |
| 17 | + emissionKind = Full> |
| 18 | +#sp_ty = #llvm.di_subroutine_type<callingConvention = DW_CC_normal> |
| 19 | +#sp = #llvm.di_subprogram<id = distinct[1]<>, compileUnit = #cu, scope = #file, |
| 20 | + name = "test_phi_locations", file = #file, subprogramFlags = Definition, |
| 21 | + type = #sp_ty> |
| 22 | + |
| 23 | +#loc1 = loc("test.f90":15:22) |
| 24 | +#loc2 = loc("test.f90":8:2) |
| 25 | +#loc3 = loc("test.f90":9:5) |
| 26 | +#loc4 = loc(fused<#sp>[#loc1]) |
| 27 | + |
| 28 | +// CHECK-LABEL: define void @test_phi_locations |
| 29 | +// CHECK: phi i32{{.*}}!dbg ![[LOC1:[0-9]+]] |
| 30 | +// CHECK: phi i64{{.*}}!dbg ![[LOC2:[0-9]+]] |
| 31 | +// CHECK: ![[LOC1]] = !DILocation(line: 8, column: 2{{.*}}) |
| 32 | +// CHECK: ![[LOC2]] = !DILocation(line: 9, column: 5{{.*}}) |
0 commit comments