1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme -target-feature +sme2 %s -emit-llvm -o - | FileCheck %s
3 typedef __attribute__((neon_vector_type(2))) int int32x2_t
;
6 // Streaming-Mode Attributes
9 // CHECK: define dso_local void @_Z12fn_streamingP11__SME_ATTRSIFvvELj1EE
10 void fn_streaming(void (*foo
)() __arm_streaming
) { foo(); }
12 // CHECK: define dso_local void @_Z23fn_streaming_compatibleP11__SME_ATTRSIFivELj2EE(
13 void fn_streaming_compatible(int (*foo
)() __arm_streaming_compatible
) { foo(); }
19 // CHECK: define dso_local void @_Z15fn_za_preservedP11__SME_ATTRSIF11__Int32x2_tvELj32EE(
20 __arm_new("za") void fn_za_preserved(int32x2_t (*foo
)() __arm_preserves("za")) { foo(); }
22 // CHECK: define dso_local void @_Z8fn_za_inP11__SME_ATTRSIFvu13__SVFloat64_tELj8EES_(
23 __arm_new("za") void fn_za_in(void (*foo
)(__SVFloat64_t
) __arm_in("za"), __SVFloat64_t x
) { foo(x
); }
25 // CHECK: define dso_local noundef i32 @_Z9fn_za_outP11__SME_ATTRSIFivELj16EE(
26 __arm_new("za") int fn_za_out(int (*foo
)() __arm_out("za")) { return foo(); }
28 // CHECK: define dso_local void @_Z11fn_za_inoutP11__SME_ATTRSIFvvELj24EE(
29 __arm_new("za") void fn_za_inout(void (*foo
)() __arm_inout("za")) { foo(); }
36 // CHECK: define dso_local void @_Z16fn_zt0_preservedP11__SME_ATTRSIFivELj256EE(
37 __arm_new("zt0") void fn_zt0_preserved(int (*foo
)() __arm_preserves("zt0")) { foo(); }
39 // CHECK: define dso_local void @_Z9fn_zt0_inP11__SME_ATTRSIFivELj64EE(
40 __arm_new("zt0") void fn_zt0_in(int (*foo
)() __arm_in("zt0")) { foo(); }
42 // CHECK: define dso_local void @_Z10fn_zt0_outP11__SME_ATTRSIFivELj128EE(
43 __arm_new("zt0") void fn_zt0_out(int (*foo
)() __arm_out("zt0")) { foo(); }
45 // CHECK: define dso_local void @_Z12fn_zt0_inoutP11__SME_ATTRSIFivELj192EE(
46 __arm_new("zt0") void fn_zt0_inout(int (*foo
)() __arm_inout("zt0")) { foo(); }
49 // Streaming-mode, ZA & ZT0 Attributes
52 // CHECK: define dso_local void @_Z17fn_all_attr_typesP11__SME_ATTRSIFivELj282EE(
53 __arm_new("za") __arm_new("zt0")
54 void fn_all_attr_types(int (*foo
)() __arm_streaming_compatible
__arm_inout("za") __arm_preserves("zt0"))
61 // CHECK: define dso_local void @_Z12no_sme_attrsPFvvE(
62 void no_sme_attrs(void (*foo
)()) { foo(); }
64 // CHECK: define dso_local void @_Z24locally_streaming_callerPFvvE(
65 __arm_locally_streaming
void locally_streaming_caller(void (*foo
)()) { foo(); }
67 // CHECK: define dso_local void @_Z16streaming_callerv(
68 void streaming_caller() __arm_streaming
{}
70 // CHECK: define dso_local void @_Z16za_shared_callerv(
71 void za_shared_caller() __arm_in("za") {}
73 // CHECK: define dso_local void @_Z17zt0_shared_callerv(
74 void zt0_shared_caller() __arm_out("zt0") {}