| 1 |
! Test that the expanded macros have the location information |
| 2 |
! RUN: %flang_fc1 -mmlir --mlir-print-debuginfo -emit-fir -o - %s | FileCheck %s |
| 3 |
|
| 4 |
#define CMD(fname) fname() |
| 5 |
|
| 6 |
subroutine foo() |
| 7 |
end subroutine |
| 8 |
|
| 9 |
subroutine test() |
| 10 |
! CHECK: fir.call @_QPfoo() fastmath<contract> : () -> () loc(#[[CALL_LOC:.*]]) |
| 11 |
call CMD(foo) |
| 12 |
end subroutine |
| 13 |
|
| 14 |
#define IVAR i |
| 15 |
|
| 16 |
integer function ifoo() |
| 17 |
ifoo = 0 |
| 18 |
end function |
| 19 |
|
| 20 |
subroutine test2() |
| 21 |
integer :: i |
| 22 |
! CHECK: fir.call @_QPifoo(){{.*}} loc(#[[IFOO_CALL_LOC:.*]]) |
| 23 |
IVAR = ifoo() |
| 24 |
end subroutine |
| 25 |
|
| 26 |
! CHECK: #[[CALL_LOC]] = loc("{{.*}}macro-debug-file-loc.f90":11:3) |
| 27 |
! CHECK: #[[IFOO_CALL_LOC]] = loc("{{.*}}macro-debug-file-loc.f90":23:3) |