1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fsyntax-only -verify %s
4 // REQUIRES: aarch64-registered-target
8 __attribute__((target("+sve2p1")))
9 svfloat32_t
good1(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) {
10 return svclamp(a
, b
, c
);
13 __attribute__((target("+sme2")))
14 svfloat32_t
good2(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) __arm_streaming
{
15 return svclamp(a
, b
, c
);
18 __attribute__((target("+sve2p1,+sme2")))
19 svfloat32_t
good3(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) __arm_streaming_compatible
{
20 return svclamp(a
, b
, c
);
23 __attribute__((target("+sve2p1,+sme2")))
24 svfloat32_t
good4(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) __arm_streaming
{
25 return svclamp(a
, b
, c
);
28 __attribute__((target("+sve2p1")))
29 svfloat32_t
good5(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) __arm_streaming_compatible
{
30 return svclamp(a
, b
, c
);
33 // Even though svclamp is not available in streaming mode without +sme2,
34 // the behaviour should be the same as above, irrespective of whether +sme
36 __attribute__((target("+sve2p1,+sme")))
37 svfloat32_t
good6(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) __arm_streaming_compatible
{
38 return svclamp(a
, b
, c
);
41 // Test that the +sve-b16b16 is not considered an SVE flag (it applies to both)
42 __attribute__((target("+sme2,+sve2,+sve-b16b16")))
43 svbfloat16_t
good7(svbfloat16_t a
, svbfloat16_t b
, svbfloat16_t c
) __arm_streaming
{
44 return svclamp_bf16(a
, b
, c
);
47 // Without '+sme2', the builtin is only valid in non-streaming mode.
48 __attribute__((target("+sve2p1,+sme")))
49 svfloat32_t
bad1(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) __arm_streaming
{
50 return svclamp(a
, b
, c
) + svclamp(a
, b
, c
); // expected-error{{builtin can only be called from a non-streaming function}} \
51 // expected-error{{builtin can only be called from a non-streaming function}}
54 // Without '+sve2p1', the builtin is only valid in streaming mode.
55 __attribute__((target("+sve2,+sme2")))
56 svfloat32_t
bad2(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) {
57 return svclamp(a
, b
, c
) + svclamp(a
, b
, c
); // expected-error{{builtin can only be called from a streaming function}} \
58 // expected-error{{builtin can only be called from a streaming function}}
61 __attribute__((target("+sve2,+sme2")))
62 svfloat32_t
bad4(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) __arm_streaming_compatible
{
63 return svclamp(a
, b
, c
) + svclamp(a
, b
, c
); // expected-error{{builtin can only be called from a streaming function}} \
64 // expected-error{{builtin can only be called from a streaming function}}
67 // We don't want a warning about undefined behaviour if none of the feature requirements of the builtin are satisfied.
68 // (this results in a target-guard error emitted by Clang CodeGen)
69 svfloat32_t
bad5(svfloat32_t a
, svfloat32_t b
, svfloat32_t c
) {
70 return svclamp(a
, b
, c
);