[compiler-rt] Add weak defs for .*contiguous_container.* functions (#120376)
[llvm-project.git] / clang / test / CodeGen / AArch64 / targetattr-arch.c
blob5de73d6027845e3ff4a1feaa0e0fbedd962f4495
1 // RUN: %clang_cc1 -triple aarch64 -target-feature +v8a -verify -DHAS8 -S %s -o -
2 // RUN: %clang_cc1 -triple aarch64 -target-feature +v8.1a -verify -DHAS81 -S %s -o -
3 // RUN: %clang_cc1 -triple aarch64 -target-feature +v9a -verify -DHAS9 -S %s -o -
4 // REQUIRES: aarch64-registered-target
6 #ifdef HAS9
7 // expected-no-diagnostics
8 #endif
10 #include <arm_acle.h>
11 #include <arm_fp16.h>
12 #include <arm_sve.h>
14 __attribute__((target("arch=armv8.1-a")))
15 int test_crc_attr()
17 return __crc32cd(1, 1);
20 __attribute__((target("arch=armv9-a")))
21 svint8_t test_svadd_attr(svbool_t pg, svint8_t op1, svint8_t op2)
23 return svadd_s8_z(pg, op1, op2);
26 __attribute__((target("arch=armv9-a")))
27 float16_t test_fp16_on_v9(float16_t x, float16_t y)
29 return vabdh_f16(x, y);
32 void test_error1()
34 #ifdef HAS8
35 // expected-error@+2{{always_inline function '__crc32cd' requires target feature 'crc'}}
36 #endif
37 __crc32cd(1, 1);
40 void test_error2()
42 #if defined(HAS8) || defined(HAS81)
43 // expected-error@+2{{SVE vector type 'svint8_t' (aka '__SVInt8_t') cannot be used in a target without sve}}
44 #endif
45 svundef_s8();