1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -o /dev/null -target-feature +sme -verify -DTEST_NONE %s
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -o /dev/null -target-feature +sme -verify -DTEST_COMPATIBLE %s
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -o /dev/null -target-feature +sme -verify -DTEST_STREAMING %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -o /dev/null -target-feature +sme -verify -DTEST_LOCALLY %s
6 // REQUIRES: aarch64-registered-target
8 #define __ai __attribute__((always_inline))
9 __ai
void inlined_fn(void) {}
10 __ai
void inlined_fn_streaming_compatible(void) __arm_streaming_compatible
{}
11 __ai
void inlined_fn_streaming(void) __arm_streaming
{}
12 __ai __arm_locally_streaming
void inlined_fn_local(void) {}
17 inlined_fn_streaming_compatible();
18 inlined_fn_streaming(); // expected-error {{always_inline function 'inlined_fn_streaming' and its caller 'caller' have mismatching streaming attributes}}
19 inlined_fn_local(); // expected-error {{always_inline function 'inlined_fn_local' and its caller 'caller' have mismatching streaming attributes}}
23 #ifdef TEST_COMPATIBLE
24 void caller_compatible(void) __arm_streaming_compatible
{
25 inlined_fn(); // expected-warning {{always_inline function 'inlined_fn' and its caller 'caller_compatible' have mismatching streaming attributes, inlining may change runtime behaviour}}
26 inlined_fn_streaming_compatible();
27 inlined_fn_streaming(); // expected-error {{always_inline function 'inlined_fn_streaming' and its caller 'caller_compatible' have mismatching streaming attributes}}
28 inlined_fn_local(); // expected-error {{always_inline function 'inlined_fn_local' and its caller 'caller_compatible' have mismatching streaming attributes}}
33 void caller_streaming(void) __arm_streaming
{
34 inlined_fn(); // expected-warning {{always_inline function 'inlined_fn' and its caller 'caller_streaming' have mismatching streaming attributes, inlining may change runtime behaviour}}
35 inlined_fn_streaming_compatible();
36 inlined_fn_streaming();
42 __arm_locally_streaming
43 void caller_local(void) {
44 inlined_fn(); // expected-warning {{always_inline function 'inlined_fn' and its caller 'caller_local' have mismatching streaming attributes, inlining may change runtime behaviour}}
45 inlined_fn_streaming_compatible();
46 inlined_fn_streaming();