brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 620c7d6 Raw
65 lines · plain
1! RUN: %flang_fc1 -fdebug-dump-symbols %s 2>&1 | FileCheck %s2 3!CHECK: Module scope: m14!CHECK:       i, PUBLIC size={{[0-9]+}} offset={{[0-9]+}}: ObjectEntity type: REAL({{[0-9]+}}) init:{{.+}}5!CHECK:       init, PUBLIC (Subroutine): Subprogram ()6!CHECK:       o, PUBLIC (CrayPointee) size={{[0-9]+}} offset={{[0-9]+}}: ObjectEntity type: REAL({{[0-9]+}})7!CHECK:       ptr, PUBLIC (CrayPointer) size={{[0-9]+}} offset={{[0-9]+}}: ObjectEntity type: INTEGER({{[0-9]+}})8module m19  implicit none10  real:: o11  real:: i = 42.012  pointer (ptr, o)13contains14  !CHECK: Subprogram scope: init15  subroutine init16    implicit none17    ptr=loc(i)18    print *, "init : o= ", o19  end subroutine init20end module m121 22!CHECK: Module scope: m223!CHECK:       i, PUBLIC: Use from i in m124!CHECK:       i2, PUBLIC size={{[0-9]+}} offset={{[0-9]+}}: ObjectEntity type: REAL({{[0-9]+}}) init:{{.+}}25!CHECK:       init, PUBLIC (Subroutine): Use from init in m126!CHECK:       o, PUBLIC (CrayPointee): Use from o in m127!CHECK:       ptr, PUBLIC (CrayPointer): Use from ptr in m128!CHECK:       reset, PUBLIC (Subroutine): Subprogram ()29module m230  use m131  implicit none32  real:: i2 = 777.033contains34  !CHECK: Subprogram scope: reset35  !CHECK:       o2 (CrayPointee) size={{[0-9]+}} offset={{[0-9]+}}: ObjectEntity type: REAL({{[0-9]+}})36  !CHECK:       ptr (CrayPointer) size={{[0-9]+}} offset={{[0-9]+}}: ObjectEntity type: INTEGER({{[0-9]+}})37  subroutine reset38    real::o239    pointer (ptr, o2)40    ptr=loc(i2)41    print *, "reset : o= ", o, " o2 = ", o242    o2 = 666.043  end subroutine reset44end module m245 46!CHECK: MainProgram scope: MAIN47!CHECK:       i: Use from i in m248!CHECK:       i2: Use from i2 in m249!CHECK:       init (Subroutine): Use from init in m250!CHECK:       o (CrayPointee): Use from o in m251!CHECK:       ptr (CrayPointer): Use from ptr in m252!CHECK:       reset (Subroutine): Use from reset in m253program main54  use m255  implicit none56  call init57  call reset58  write(6,*) "main : o = ", o59  if (o == 42.0) then60    print *, "pass"61  else62    print *, "fail"63  end if64end program main65