Debian Codegraph @

gcc/testsuite/g++.target/aarch64/sme/exceptions_2.C

raw
1 // { dg-options "-O -fno-optimize-sibling-calls" }
2 // { dg-final { check-function-bodies "**" "" } }
3
4 void n_callee();
5 void s_callee() __arm_streaming;
6 void sc_callee() __arm_streaming_compatible;
7
8 void n_callee_ne() noexcept;
9 void s_callee_ne() noexcept __arm_streaming;
10 void sc_callee_ne() noexcept __arm_streaming_compatible;
11
12 void n_caller1()
13 {
14 try
15 {
16 n_callee();
17 sc_callee();
18 }
19 catch (...)
20 {
21 n_callee_ne();
22 sc_callee_ne();
23 }
24 }
25 // { dg-final { scan-assembler {_Z9n_caller1v:(?:(?!smstart|smstop).)*\tret} } }
26
27 /*
28 ** _Z9n_caller2v:
29 ** ...
30 ** cntd (x[0-9]+)
31 ** str \1, [^\n]+
32 ** ...
33 ** bl __cxa_begin_catch
34 ** smstart sm
35 ** bl _Z11s_callee_nev
36 ** smstop sm
37 ** bl __cxa_end_catch
38 ** ...
39 */
40 void n_caller2()
41 {
42 try
43 {
44 n_callee();
45 sc_callee();
46 }
47 catch (...)
48 {
49 s_callee_ne();
50 }
51 }
52
53 /*
54 ** _Z9s_caller1v:
55 ** ...
56 ** bl __cxa_end_catch
57 ** smstart sm
58 ** ...
59 */
60 int s_caller1() __arm_streaming
61 {
62 try
63 {
64 s_callee();
65 return 1;
66 }
67 catch (...)
68 {
69 return 2;
70 }
71 }
72
73 /*
74 ** _Z9s_caller2v:
75 ** ...
76 ** bl __cxa_begin_catch
77 ** smstart sm
78 ** bl _Z11s_callee_nev
79 ** smstop sm
80 ** bl __cxa_end_catch
81 ** smstart sm
82 ** ...
83 */
84 int s_caller2() __arm_streaming
85 {
86 try
87 {
88 n_callee();
89 return 1;
90 }
91 catch (...)
92 {
93 s_callee_ne();
94 return 2;
95 }
96 }
97
98 /*
99 ** _Z10sc_caller1v:
100 ** ...
101 ** cntd (x[0-9]+)
102 ** str \1, [^\n]+
103 ** mrs (x[0-9]+), svcr
104 ** str \2, ([^\n]+)
105 ** ...
106 ** bl __cxa_end_catch
107 ** ldr (x[0-9]+), \3
108 ** tbz \4, 0, [^\n]+
109 ** smstart sm
110 ** ...
111 */
112 int sc_caller1() __arm_streaming_compatible
113 {
114 try
115 {
116 sc_callee();
117 return 1;
118 }
119 catch (...)
120 {
121 return 2;
122 }
123 }
124
125 /*
126 ** _Z10ls_caller1v:
127 ** ...
128 ** cntd (x[0-9]+)
129 ** str \1, [^\n]+
130 ** ...
131 ** bl __cxa_begin_catch
132 ** smstart sm
133 ** bl _Z12sc_callee_nev
134 ** smstop sm
135 ** bl __cxa_end_catch
136 ** ...
137 */
138 __arm_locally_streaming void ls_caller1()
139 {
140 try
141 {
142 sc_callee();
143 }
144 catch (...)
145 {
146 sc_callee_ne();
147 }
148 }