| 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 { |
| 7 |
func.func @test1(%x : complex<f32>) -> complex<f64> { |
| 8 |
%1 = fir.convert %x : (complex<f32>) -> complex<f64> |
| 9 |
return %1 : complex<f64> |
| 10 |
}loc(#loc1) |
| 11 |
func.func @test2(%x : complex<f32>) -> complex<f64> { |
| 12 |
%1 = fir.convert %x : (complex<f32>) -> complex<f64> |
| 13 |
return %1 : complex<f64> |
| 14 |
}loc(#loc2) |
| 15 |
func.func @test3(%x : complex<f32>) -> complex<f128> { |
| 16 |
%1 = fir.convert %x : (complex<f32>) -> complex<f128> |
| 17 |
return %1 : complex<f128> |
| 18 |
}loc(#loc3) |
| 19 |
func.func @test4(%x : complex<f32>) -> complex<f128> { |
| 20 |
%1 = fir.convert %x : (complex<f32>) -> 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]]> |