|
| 1 | +// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s |
| 2 | + |
| 3 | +// check conversion of complex type of different size. Both fir and mlir |
| 4 | +// variants are checked. |
| 5 | + |
| 6 | +module attributes {fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.target_triple = "native"} { |
| 7 | + func.func @test1(%x : !fir.complex<4>) -> !fir.complex<8> { |
| 8 | + %1 = fir.convert %x : (!fir.complex<4>) -> !fir.complex<8> |
| 9 | + return %1 : !fir.complex<8> |
| 10 | + }loc(#loc1) |
| 11 | + func.func @test2(%x : !fir.complex<4>) -> complex<f64> { |
| 12 | + %1 = fir.convert %x : (!fir.complex<4>) -> complex<f64> |
| 13 | + return %1 : complex<f64> |
| 14 | + }loc(#loc2) |
| 15 | + func.func @test3(%x : !fir.complex<4>) -> !fir.complex<16> { |
| 16 | + %1 = fir.convert %x : (!fir.complex<4>) -> !fir.complex<16> |
| 17 | + return %1 : !fir.complex<16> |
| 18 | + }loc(#loc3) |
| 19 | + func.func @test4(%x : !fir.complex<4>) -> complex<f128> { |
| 20 | + %1 = fir.convert %x : (!fir.complex<4>) -> complex<f128> |
| 21 | + return %1 : complex<f128> |
| 22 | + }loc(#loc4) |
| 23 | +} |
| 24 | +#loc1 = loc("./simple.f90":2:1) |
| 25 | +#loc2 = loc("./simple.f90":5:1) |
| 26 | +#loc3 = loc("./simple.f90":8:1) |
| 27 | +#loc4 = loc("./simple.f90":11:1) |
| 28 | + |
| 29 | +// CHECK-DAG: #[[CMPX8:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "complex", sizeInBits = 128, encoding = DW_ATE_complex_float> |
| 30 | +// CHECK-DAG: #[[CMPX4:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "complex", sizeInBits = 64, encoding = DW_ATE_complex_float> |
| 31 | +// CHECK-DAG: #[[CMPX16:.*]] = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "complex", sizeInBits = 256, encoding = DW_ATE_complex_float> |
| 32 | + |
| 33 | +// CHECK-DAG: #[[TY1:.*]] = #llvm.di_subroutine_type<{{.*}}types = #[[CMPX8]], #[[CMPX4]]> |
| 34 | +// CHECK-DAG: #[[TY2:.*]] = #llvm.di_subroutine_type<{{.*}}types = #[[CMPX16]], #[[CMPX4]]> |
| 35 | + |
| 36 | +// CHECK-DAG: #llvm.di_subprogram<{{.*}}name = "test1"{{.*}}type = #[[TY1]]> |
| 37 | +// CHECK-DAG: #llvm.di_subprogram<{{.*}}name = "test2"{{.*}}type = #[[TY1]]> |
| 38 | +// CHECK-DAG: #llvm.di_subprogram<{{.*}}name = "test3"{{.*}}type = #[[TY2]]> |
| 39 | +// CHECK-DAG: #llvm.di_subprogram<{{.*}}name = "test4"{{.*}}type = #[[TY2]]> |
0 commit comments