2 -- { dg-options "-fstrub=strict" }
3 -- { dg-require-effective-target strub }
5 -- This is essentially the same test as strub_attr.adb,
6 -- but with an explicit conversion.
8 package body Strub_Ind2
is
11 function G
return Integer;
12 pragma Machine_Attribute
(G
, "strub", "callable");
14 procedure P
(X
: Integer) is
19 function G
return Integer is (FP
(X
));
21 type GT
is access function return Integer;
22 pragma Machine_Attribute
(GT
, "strub", "callable");
24 type GT_SD
is access function return Integer;
25 pragma Machine_Attribute
(GT_SD
, "strub", "disabled");
27 GP
: GT_SD
:= GT_SD
(GT
'(G'Access));
28 -- pragma Machine_Attribute (GP, "strub", "disabled"); -- not needed.
30 function F (X : Integer) return Integer is
32 return X * GP.all; -- { dg-error "using non-.strub. type" }