52 lines · plain
1! RUN: %python %S/test_symbols.py %s %flang_fc12 3! Test that a procedure is only implicitly resolved as an intrinsic function4! (resp. subroutine) if this is a function (resp. subroutine)5 6!DEF: /expect_external (Subroutine) Subprogram7subroutine expect_external8 !DEF: /acos EXTERNAL (Subroutine) ProcEntity9 !DEF: /expect_external/x (Implicit) ObjectEntity REAL(4)10 call acos(x)11 !DEF: /expect_external/i (Implicit) ObjectEntity INTEGER(4)12 !DEF: /system_clock EXTERNAL (Function, Implicit) ProcEntity REAL(4)13 !DEF: /expect_external/icount (Implicit) ObjectEntity INTEGER(4)14 i = system_clock(icount)15end subroutine16 17!DEF: /expect_intrinsic (Subroutine) Subprogram18subroutine expect_intrinsic19 !DEF: /expect_intrinsic/y (Implicit) ObjectEntity REAL(4)20 !DEF: /expect_intrinsic/acos ELEMENTAL, INTRINSIC, PURE (Function) ProcEntity21 !DEF: /expect_intrinsic/x (Implicit) ObjectEntity REAL(4)22 y = acos(x)23 !DEF: /expect_intrinsic/system_clock INTRINSIC (Subroutine) ProcEntity24 !DEF: /expect_intrinsic/icount (Implicit) ObjectEntity INTEGER(4)25 call system_clock(icount)26end subroutine27 28! Sanity check that the EXTERNAL attribute is not bypassed by29! implicit intrinsic resolution, even if it otherwise perfectly30! matches an intrinsic call.31 32!DEF: /expect_external_2 (Subroutine) Subprogram33subroutine expect_external_234 !DEF: /expect_external_2/matmul EXTERNAL (Function, Implicit) ProcEntity INTEGER(4)35 external :: matmul36 !DEF: /expect_external_2/cpu_time EXTERNAL (Subroutine) ProcEntity37 external :: cpu_time38 !DEF: /expect_external_2/x ObjectEntity REAL(4)39 !DEF: /expect_external_2/y ObjectEntity REAL(4)40 !DEF: /expect_external_2/z ObjectEntity REAL(4)41 !DEF: /expect_external_2/t ObjectEntity REAL(4)42 real x(2,2), y(2), z(2), t43 !REF: /expect_external_2/z44 !REF: /expect_external_2/matmul45 !REF: /expect_external_2/x46 !REF: /expect_external_2/y47 z = matmul(x, y)48 !REF: /expect_external_2/cpu_time49 !REF: /expect_external_2/t50 call cpu_time(t)51end subroutine52