brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 68102c9 Raw
54 lines · c
1// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -o /dev/null -target-feature +sme -target-feature +sme2 -verify -DTEST_NONE %s2// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -o /dev/null -target-feature +sme -target-feature +sme2 -verify -DTEST_COMPATIBLE %s3// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -o /dev/null -target-feature +sme -target-feature +sme2 -verify -DTEST_STREAMING %s4// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -S -o /dev/null -target-feature +sme -target-feature +sme2 -verify -DTEST_LOCALLY %s5 6// REQUIRES: aarch64-registered-target7 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) {}13__ai __arm_new("za") void inlined_fn_za(void) {}14__ai __arm_new("zt0") void inlined_fn_zt0(void) {}15 16#ifdef TEST_NONE17void caller(void) {18    inlined_fn();19    inlined_fn_streaming_compatible();20    inlined_fn_streaming(); // expected-error {{always_inline function 'inlined_fn_streaming' and its caller 'caller' have mismatching streaming attributes}}21    inlined_fn_local(); // expected-error {{always_inline function 'inlined_fn_local' and its caller 'caller' have mismatching streaming attributes}}22    inlined_fn_za(); // expected-error {{always_inline function 'inlined_fn_za' has new za state}}23    inlined_fn_zt0(); // expected-error {{always_inline function 'inlined_fn_zt0' has new zt0 state}}24}25#endif26 27#ifdef TEST_COMPATIBLE28void caller_compatible(void) __arm_streaming_compatible {29    inlined_fn(); // expected-warning {{always_inline function 'inlined_fn' and its caller 'caller_compatible' have mismatching streaming attributes, inlining may change runtime behaviour}}30    inlined_fn_streaming_compatible();31    inlined_fn_streaming(); // expected-error {{always_inline function 'inlined_fn_streaming' and its caller 'caller_compatible' have mismatching streaming attributes}}32    inlined_fn_local(); // expected-error {{always_inline function 'inlined_fn_local' and its caller 'caller_compatible' have mismatching streaming attributes}}33}34#endif35 36#ifdef TEST_STREAMING37void caller_streaming(void) __arm_streaming {38    inlined_fn(); // expected-warning {{always_inline function 'inlined_fn' and its caller 'caller_streaming' have mismatching streaming attributes, inlining may change runtime behaviour}}39    inlined_fn_streaming_compatible();40    inlined_fn_streaming();41    inlined_fn_local();42}43#endif44 45#ifdef TEST_LOCALLY46__arm_locally_streaming47void caller_local(void) {48    inlined_fn(); // expected-warning {{always_inline function 'inlined_fn' and its caller 'caller_local' have mismatching streaming attributes, inlining may change runtime behaviour}}49    inlined_fn_streaming_compatible();50    inlined_fn_streaming();51    inlined_fn_local();52}53#endif54