66 lines · plain
1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s2 3#int_ty = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "integer",4 sizeInBits = 32, encoding = DW_ATE_signed>5#real_ty = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "real",6 sizeInBits = 32, encoding = DW_ATE_float>7#file = #llvm.di_file<"target.f90" in "">8#di_null_type = #llvm.di_null_type9#cu = #llvm.di_compile_unit<id = distinct[0]<>,10 sourceLanguage = DW_LANG_Fortran95, file = #file, isOptimized = false,11 emissionKind = Full>12#array_ty = #llvm.di_composite_type<tag = DW_TAG_array_type,13 baseType = #int_ty, elements = #llvm.di_subrange<count = 10 : i64>>14#sp_ty = #llvm.di_subroutine_type<callingConvention = DW_CC_program,15 types = #di_null_type>16#g_var = #llvm.di_global_variable<scope = #cu, name = "arr",17 linkageName = "_QFEarr", file = #file, line = 4,18 type = #array_ty, isDefined = true>19#g_var_expr = #llvm.di_global_variable_expression<var = #g_var>20#sp = #llvm.di_subprogram<id = distinct[2]<>, compileUnit = #cu, scope = #file,21 name = "test", file = #file, subprogramFlags = "Definition", type = #sp_ty>22#sp1 = #llvm.di_subprogram<id = distinct[3]<>, compileUnit = #cu, scope = #file,23 name = "target", file = #file, subprogramFlags = "Definition", type = #sp_ty>24#var_arr = #llvm.di_local_variable<scope = #sp1,25 name = "arr", file = #file, line = 4, type = #array_ty>26#var_i = #llvm.di_local_variable<scope = #sp1,27 name = "i", file = #file, line = 13, type = #int_ty>28#var_x = #llvm.di_local_variable<scope = #sp1,29 name = "x", file = #file, line = 12, type = #real_ty>30 31module attributes {omp.is_target_device = false} {32 llvm.func @test() {33 %0 = llvm.mlir.constant(1 : i64) : i6434 %1 = llvm.alloca %0 x f32 : (i64) -> !llvm.ptr35 %4 = llvm.alloca %0 x i32 : (i64) -> !llvm.ptr36 %6 = llvm.mlir.constant(9 : index) : i6437 %7 = llvm.mlir.constant(0 : index) : i6438 %8 = llvm.mlir.constant(1 : index) : i6439 %10 = llvm.mlir.constant(10 : index) : i6440 %11 = llvm.mlir.addressof @_QFEarr : !llvm.ptr41 %14 = omp.map.info var_ptr(%1 : !llvm.ptr, f32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr42 %15 = omp.map.bounds lower_bound(%7 : i64) upper_bound(%6 : i64) extent(%10 : i64) stride(%8 : i64) start_idx(%8 : i64)43 %16 = omp.map.info var_ptr(%11 : !llvm.ptr, !llvm.array<10 x i32>) map_clauses(tofrom) capture(ByRef) bounds(%15) -> !llvm.ptr44 %17 = omp.map.info var_ptr(%4 : !llvm.ptr, i32) map_clauses(implicit, exit_release_or_enter_alloc) capture(ByCopy) -> !llvm.ptr45 omp.target map_entries(%14 -> %arg0, %16 -> %arg1, %17 -> %arg2 : !llvm.ptr, !llvm.ptr, !llvm.ptr) {46 llvm.intr.dbg.declare #var_x = %arg0 : !llvm.ptr47 llvm.intr.dbg.declare #var_arr = %arg1 : !llvm.ptr48 llvm.intr.dbg.declare #var_i = %arg2 : !llvm.ptr49 omp.terminator50 } loc(#loc5)51 llvm.return52 } loc(#loc3)53 llvm.mlir.global internal @_QFEarr() {addr_space = 0 : i32, dbg_exprs = [#g_var_expr]} : !llvm.array<10 x i32> {54 } loc(#loc4)55}56#loc1 = loc("target.f90":4:7)57#loc2 = loc("target.f90":11:7)58#loc3 = loc(fused<#sp>[#loc2])59#loc4 = loc(fused<#g_var>[#loc1])60#loc5 = loc(fused<#sp1>[#loc2])61 62// CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "target"{{.*}})63// CHECK: !DILocalVariable(name: "x", arg: 1, scope: ![[SP]]{{.*}})64// CHECK: !DILocalVariable(name: "arr", arg: 2, scope: ![[SP]]{{.*}})65// CHECK: !DILocalVariable(name: "i", arg: 3, scope: ![[SP]]{{.*}})66