Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / AArch64 / sme-inline-streaming-attrs.c
blob9c3d08a25945a3244229a02f89b2abe8ee1e94d4
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) {}
14 #ifdef TEST_NONE
15 void caller(void) {
16 inlined_fn();
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}}
21 #endif
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}}
30 #endif
32 #ifdef TEST_STREAMING
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();
37 inlined_fn_local();
39 #endif
41 #ifdef TEST_LOCALLY
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();
47 inlined_fn_local();
49 #endif