1! RUN: %python %S/test_symbols.py %s %flang_fc1 2 3! Test that a procedure is only implicitly resolved as an intrinsic function 4! (resp. subroutine) if this is a function (resp. subroutine) 5 6!DEF: /expect_external (Subroutine) Subprogram 7subroutine expect_external 8 !DEF: /acos EXTERNAL (Subroutine) ProcEntity 9 !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 subroutine 16 17!DEF: /expect_intrinsic (Subroutine) Subprogram 18subroutine expect_intrinsic 19 !DEF: /expect_intrinsic/y (Implicit) ObjectEntity REAL(4) 20 !DEF: /expect_intrinsic/acos ELEMENTAL, INTRINSIC, PURE (Function) ProcEntity 21 !DEF: /expect_intrinsic/x (Implicit) ObjectEntity REAL(4) 22 y = acos(x) 23 !DEF: /expect_intrinsic/system_clock INTRINSIC (Subroutine) ProcEntity 24 !DEF: /expect_intrinsic/icount (Implicit) ObjectEntity INTEGER(4) 25 call system_clock(icount) 26end subroutine 27 28! Sanity check that the EXTERNAL attribute is not bypassed by 29! implicit intrinsic resolution, even if it otherwise perfectly 30! matches an intrinsic call. 31 32!DEF: /expect_external_2 (Subroutine) Subprogram 33subroutine expect_external_2 34 !DEF: /expect_external_2/matmul EXTERNAL (Function, Implicit) ProcEntity INTEGER(4) 35 external :: matmul 36 !DEF: /expect_external_2/cpu_time EXTERNAL (Subroutine) ProcEntity 37 external :: cpu_time 38 !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), t 43 !REF: /expect_external_2/z 44 !REF: /expect_external_2/matmul 45 !REF: /expect_external_2/x 46 !REF: /expect_external_2/y 47 z = matmul(x, y) 48 !REF: /expect_external_2/cpu_time 49 !REF: /expect_external_2/t 50 call cpu_time(t) 51end subroutine 52