27 lines · plain
1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s2 3// This tests the fix for https://github.com/llvm/llvm-project/issues/846064// We are only interested in ensuring that the -mlir-to-llmvir pass doesn't crash.5// CHECK: {{.*}} = add i32 {{.*}}, 56module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {7 llvm.func @_QQmain() attributes {fir.bindc_name = "main", omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {8 %0 = llvm.mlir.constant(0 : i32) : i329 %1 = llvm.mlir.constant(1 : i64) : i6410 %2 = llvm.alloca %1 x i32 {bindc_name = "a"} : (i64) -> !llvm.ptr<5>11 %3 = llvm.addrspacecast %2 : !llvm.ptr<5> to !llvm.ptr12 omp.task {13 llvm.store %0, %3 : i32, !llvm.ptr14 omp.terminator15 }16 %4 = omp.map.info var_ptr(%3 : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = "a"}17 omp.target map_entries(%4 -> %arg0 : !llvm.ptr) {18 %5 = llvm.mlir.constant(5 : i32) : i3219 %6 = llvm.load %arg0 : !llvm.ptr -> i3220 %7 = llvm.add %6, %5 : i3221 llvm.store %7, %arg0 : i32, !llvm.ptr22 omp.terminator23 }24 llvm.return25 }26}27