strub: enable conditional support
[official-gcc.git] / gcc / testsuite / gnat.dg / strub_renm1.adb
blob68d3230b5356c0cde2423dbb783f19b65bf36b10
1 -- { dg-do compile }
2 -- { dg-options "-fstrub=relaxed -fdump-ipa-strub" }
3 -- { dg-require-effective-target strub }
5 procedure Strub_Renm1 is
6 V : Integer := 0;
7 pragma Machine_Attribute (V, "strub");
9 procedure P (X : Integer);
10 pragma Machine_Attribute (P, "strub", "at-calls");
12 function F return Integer;
14 procedure Q (X : Integer) renames P;
15 pragma Machine_Attribute (Q, "strub", "at-calls");
17 function G return Integer renames F;
18 pragma Machine_Attribute (G, "strub", "internal");
20 procedure P (X : Integer) is null;
21 function F return Integer is (0);
23 begin
24 P (F);
25 Q (G);
26 end Strub_Renm1;
28 -- This is for P; Q is an alias.
29 -- { dg-final { scan-ipa-dump-times "\[(\]strub \[(\]at-calls\[)\]\[)\]" 1 "strub" } }
31 -- This is *not* for G, but for Strub_Renm1.
32 -- { dg-final { scan-ipa-dump-times "\[(\]strub \[(\]wrapped\[)\]\[)\]" 1 "strub" } }
33 -- { dg-final { scan-ipa-dump-times "\[(\]strub \[(\]wrapper\[)\]\[)\]" 1 "strub" } }