Debian Codegraph @

clang/test/CodeGenCXX/aarch64-mangle-sme-atts.cpp

raw
1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme -target-feature +sme2 %s -emit-llvm -o - | FileCheck %s
2
3 typedef __attribute__((neon_vector_type(2))) int int32x2_t;
4
5 //
6 // Streaming-Mode Attributes
7 //
8
9 // CHECK: define dso_local void @_Z12fn_streamingP11__SME_ATTRSIFvvELj1EE
10 void fn_streaming(void (*foo)() __arm_streaming) { foo(); }
11
12 // CHECK: define dso_local void @_Z23fn_streaming_compatibleP11__SME_ATTRSIFivELj2EE(
13 void fn_streaming_compatible(int (*foo)() __arm_streaming_compatible) { foo(); }
14
15 //
16 // ZA Attributes
17 //
18
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(); }
21
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); }
24
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(); }
27
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(); }
30
31
32 //
33 // ZT0 Attributes
34 //
35
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(); }
38
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(); }
41
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(); }
44
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(); }
47
48 //
49 // __arm_agnostic("sme_za_state") Attribute
50 //
51
52 // CHECK: define dso_local void @_Z24fn_sme_za_state_agnosticP11__SME_ATTRSIFvvELj4EE(
53 void fn_sme_za_state_agnostic(void (*foo)() __arm_agnostic("sme_za_state")) { foo(); }
54
55 // CHECK: define dso_local void @_Z34fn_sme_za_state_streaming_agnosticP11__SME_ATTRSIFvvELj5EE(
56 void fn_sme_za_state_streaming_agnostic(void (*foo)() __arm_streaming __arm_agnostic("sme_za_state")) { foo(); }
57
58 //
59 // Streaming-mode, ZA & ZT0 Attributes
60 //
61
62 // CHECK: define dso_local void @_Z17fn_all_attr_typesP11__SME_ATTRSIFivELj282EE(
63 __arm_new("za") __arm_new("zt0")
64 void fn_all_attr_types(int (*foo)() __arm_streaming_compatible __arm_inout("za") __arm_preserves("zt0"))
65 { foo(); }
66
67 //
68 // No SME Attributes
69 //
70
71 // CHECK: define dso_local void @_Z12no_sme_attrsPFvvE(
72 void no_sme_attrs(void (*foo)()) { foo(); }
73
74 // CHECK: define dso_local void @_Z24locally_streaming_callerPFvvE(
75 __arm_locally_streaming void locally_streaming_caller(void (*foo)()) { foo(); }
76
77 // CHECK: define dso_local void @_Z16streaming_callerv(
78 void streaming_caller() __arm_streaming {}
79
80 // CHECK: define dso_local void @_Z16za_shared_callerv(
81 void za_shared_caller() __arm_in("za") {}
82
83 // CHECK: define dso_local void @_Z17zt0_shared_callerv(
84 void zt0_shared_caller() __arm_out("zt0") {}