1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple loongarch32 -emit-llvm -S -verify %s -o /dev/null
4 #include <larchintrin.h>
6 void cacop_d(unsigned long int a
) {
7 __builtin_loongarch_cacop_d(1, a
, 1024); // expected-error {{this builtin requires target: loongarch64}}
8 __builtin_loongarch_cacop_w(-1, a
, 1024); // expected-error {{argument value -1 is outside the valid range [0, 31]}}
9 __builtin_loongarch_cacop_w(32, a
, 1024); // expected-error {{argument value 32 is outside the valid range [0, 31]}}
10 __builtin_loongarch_cacop_w(1, a
, -4096); // expected-error {{argument value -4096 is outside the valid range [-2048, 2047]}}
11 __builtin_loongarch_cacop_w(1, a
, 4096); // expected-error {{argument value 4096 is outside the valid range [-2048, 2047]}}
15 __builtin_loongarch_dbar(32768); // expected-error {{argument value 32768 is outside the valid range [0, 32767]}}
16 __builtin_loongarch_dbar(-1); // expected-error {{argument value 4294967295 is outside the valid range [0, 32767]}}
17 __builtin_loongarch_dbar(a
); // expected-error {{argument to '__builtin_loongarch_dbar' must be a constant integer}}
21 __builtin_loongarch_ibar(32769); // expected-error {{argument value 32769 is outside the valid range [0, 32767]}}
22 __builtin_loongarch_ibar(-1); // expected-error {{argument value 4294967295 is outside the valid range [0, 32767]}}
23 __builtin_loongarch_ibar(a
); // expected-error {{argument to '__builtin_loongarch_ibar' must be a constant integer}}
26 void loongarch_break(int a
) {
27 __builtin_loongarch_break(32769); // expected-error {{argument value 32769 is outside the valid range [0, 32767]}}
28 __builtin_loongarch_break(-1); // expected-error {{argument value 4294967295 is outside the valid range [0, 32767]}}
29 __builtin_loongarch_break(a
); // expected-error {{argument to '__builtin_loongarch_break' must be a constant integer}}
32 int movfcsr2gr_out_of_lo_range(int a
) {
33 int b
= __builtin_loongarch_movfcsr2gr(-1); // expected-error {{argument value 4294967295 is outside the valid range [0, 3]}}
34 int c
= __builtin_loongarch_movfcsr2gr(32); // expected-error {{argument value 32 is outside the valid range [0, 3]}}
35 int d
= __builtin_loongarch_movfcsr2gr(a
); // expected-error {{argument to '__builtin_loongarch_movfcsr2gr' must be a constant integer}}
39 void movgr2fcsr(int a
, int b
) {
40 __builtin_loongarch_movgr2fcsr(-1, b
); // expected-error {{argument value 4294967295 is outside the valid range [0, 3]}}
41 __builtin_loongarch_movgr2fcsr(32, b
); // expected-error {{argument value 32 is outside the valid range [0, 3]}}
42 __builtin_loongarch_movgr2fcsr(a
, b
); // expected-error {{argument to '__builtin_loongarch_movgr2fcsr' must be a constant integer}}
46 __builtin_loongarch_syscall(32769); // expected-error {{argument value 32769 is outside the valid range [0, 32767]}}
47 __builtin_loongarch_syscall(-1); // expected-error {{argument value 4294967295 is outside the valid range [0, 32767]}}
48 __builtin_loongarch_syscall(a
); // expected-error {{argument to '__builtin_loongarch_syscall' must be a constant integer}}
51 int crc_w_b_w(char a
, int b
) {
52 return __builtin_loongarch_crc_w_b_w(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
55 int crc_w_h_w(short a
, int b
) {
56 return __builtin_loongarch_crc_w_h_w(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
59 int crc_w_w_w(int a
, int b
) {
60 return __builtin_loongarch_crc_w_w_w(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
63 int crc_w_d_w(long int a
, int b
) {
64 return __builtin_loongarch_crc_w_d_w(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
66 int crcc_w_b_w(char a
, int b
) {
67 return __builtin_loongarch_crcc_w_b_w(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
70 int crcc_w_h_w(short a
, int b
) {
71 return __builtin_loongarch_crcc_w_h_w(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
74 int crcc_w_w_w(int a
, int b
) {
75 return __builtin_loongarch_crcc_w_w_w(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
78 int crcc_w_d_w(long int a
, int b
) {
79 return __builtin_loongarch_crcc_w_d_w(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
82 unsigned long int csrrd_d() {
83 return __builtin_loongarch_csrrd_d(1); // expected-error {{this builtin requires target: loongarch64}}
86 unsigned long int csrwr_d(unsigned long int a
) {
87 return __builtin_loongarch_csrwr_d(a
, 1); // expected-error {{this builtin requires target: loongarch64}}
90 unsigned long int csrxchg_d(unsigned long int a
, unsigned long int b
) {
91 return __builtin_loongarch_csrxchg_d(a
, b
, 1); // expected-error {{this builtin requires target: loongarch64}}
95 __builtin_loongarch_csrrd_w(16384); // expected-error {{argument value 16384 is outside the valid range [0, 16383]}}
96 __builtin_loongarch_csrrd_w(-1); // expected-error {{argument value 4294967295 is outside the valid range [0, 16383]}}
97 __builtin_loongarch_csrrd_w(a
); // expected-error {{argument to '__builtin_loongarch_csrrd_w' must be a constant integer}}
100 void csrwr_w(unsigned int a
) {
101 __builtin_loongarch_csrwr_w(a
, 16384); // expected-error {{argument value 16384 is outside the valid range [0, 16383]}}
102 __builtin_loongarch_csrwr_w(a
, -1); // expected-error {{argument value 4294967295 is outside the valid range [0, 16383]}}
103 __builtin_loongarch_csrwr_w(a
, a
); // expected-error {{argument to '__builtin_loongarch_csrwr_w' must be a constant integer}}
106 void csrxchg_w(unsigned int a
, unsigned int b
) {
107 __builtin_loongarch_csrxchg_w(a
, b
, 16384); // expected-error {{argument value 16384 is outside the valid range [0, 16383]}}
108 __builtin_loongarch_csrxchg_w(a
, b
, -1); // expected-error {{argument value 4294967295 is outside the valid range [0, 16383]}}
109 __builtin_loongarch_csrxchg_w(a
, b
, b
); // expected-error {{argument to '__builtin_loongarch_csrxchg_w' must be a constant integer}}
112 unsigned long int iocsrrd_d(unsigned int a
) {
113 return __builtin_loongarch_iocsrrd_d(a
); // expected-error {{this builtin requires target: loongarch64}}
116 void iocsrwr_d(unsigned long int a
, unsigned int b
) {
117 __builtin_loongarch_iocsrwr_d(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
120 void asrtle_d(long int a
, long int b
) {
121 __builtin_loongarch_asrtle_d(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
124 void asrtgt_d(long int a
, long int b
) {
125 __builtin_loongarch_asrtgt_d(a
, b
); // expected-error {{this builtin requires target: loongarch64}}
128 void lddir_d(long int a
, int b
) {
129 __builtin_loongarch_lddir_d(a
, 1); // expected-error {{this builtin requires target: loongarch64}}
132 void ldpte_d(long int a
, int b
) {
133 __builtin_loongarch_ldpte_d(a
, 1); // expected-error {{this builtin requires target: loongarch64}}
137 __rdtime_d(); // expected-error {{call to undeclared function '__rdtime_d'}}