Debian Codegraph @

gcc/testsuite/gnat.dg/strub_access.adb

raw
1 -- { dg-do compile }
2 -- { dg-options "-fstrub=relaxed -fdump-ipa-strubm" }
3 -- { dg-require-effective-target strub }
4
5 -- The main subprogram doesn't read from the automatic variable, but
6 -- being an automatic variable, its presence should be enough for the
7 -- procedure to get strub enabled.
8
9 procedure Strub_Access is
10 type Strub_Int is new Integer;
11 pragma Machine_Attribute (Strub_Int, "strub");
12
13 X : aliased Strub_Int := 0;
14
15 function F (P : access Strub_Int) return Strub_Int is (P.all);
16
17 begin
18 X := F (X'Access);
19 end Strub_Access;
20
21 -- { dg-final { scan-ipa-dump-times "\[(\]strub \[(\]internal\[)\]\[)\]" 1 "strubm" } }
22 -- { dg-final { scan-ipa-dump-times "\[(\]strub \[(\]at-calls-opt\[)\]\[)\]" 1 "strubm" } }