[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / arm-special-register.c
blob35dda25a00ebb23a8342ffe12c63cb0016960871
1 // RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify -triple arm %s
3 void string_literal(unsigned v) {
4 __builtin_arm_wsr(0, v); // expected-error {{expression is not a string literal}}
7 void wsr_1(unsigned v) {
8 __builtin_arm_wsr("sysreg", v);
11 void wsrp_1(void *v) {
12 __builtin_arm_wsrp("sysreg", v);
15 void wsr64_1(unsigned long v) {
16 __builtin_arm_wsr64("sysreg", v); //expected-error {{invalid special register for builtin}}
19 unsigned rsr_1(void) {
20 return __builtin_arm_rsr("sysreg");
23 void *rsrp_1(void) {
24 return __builtin_arm_rsrp("sysreg");
27 unsigned long rsr64_1(void) {
28 return __builtin_arm_rsr64("sysreg"); //expected-error {{invalid special register for builtin}}
31 void wsr_2(unsigned v) {
32 __builtin_arm_wsr("cp0:1:c2:c3:4", v);
35 void wsrp_2(void *v) {
36 __builtin_arm_wsrp("cp0:1:c2:c3:4", v);
39 void wsr64_2(unsigned long v) {
40 __builtin_arm_wsr64("cp0:1:c2:c3:4", v); //expected-error {{invalid special register for builtin}}
43 unsigned rsr_2(void) {
44 return __builtin_arm_rsr("cp0:1:c15:c15:4");
47 void *rsrp_2(void) {
48 return __builtin_arm_rsrp("cp0:1:c2:c3:4");
51 unsigned long rsr64_2(void) {
52 return __builtin_arm_rsr64("cp0:1:c2:c3:4"); //expected-error {{invalid special register for builtin}}
55 void wsr_3(unsigned v) {
56 __builtin_arm_wsr("cp0:1:c2", v); //expected-error {{invalid special register for builtin}}
59 void wsrp_3(void *v) {
60 __builtin_arm_wsrp("cp0:1:c2", v); //expected-error {{invalid special register for builtin}}
63 void wsr64_3(unsigned long v) {
64 __builtin_arm_wsr64("cp0:1:c2", v);
67 unsigned rsr_3(void) {
68 return __builtin_arm_rsr("cp0:1:c2"); //expected-error {{invalid special register for builtin}}
71 void *rsrp_3(void) {
72 return __builtin_arm_rsrp("cp0:1:c2"); //expected-error {{invalid special register for builtin}}
75 unsigned long rsr64_3(void) {
76 return __builtin_arm_rsr64("cp0:1:c15");
79 unsigned rsr_4(void) {
80 return __builtin_arm_rsr("0:1:2:3:4"); //expected-error {{invalid special register for builtin}}
83 unsigned rsr_5(void) {
84 return __builtin_arm_rsr("cp0:1:c2:c3:8"); //expected-error {{invalid special register for builtin}}
87 unsigned rsr_6(void) {
88 return __builtin_arm_rsr("cp0:8:c1:c2:3"); //expected-error {{invalid special register for builtin}}
91 unsigned rsr_7(void) {
92 return __builtin_arm_rsr("cp0:1:c16:c16:2"); //expected-error {{invalid special register for builtin}}
95 void *rsrp_4(void) {
96 return __builtin_arm_rsrp("0:1:2:3:4"); //expected-error {{invalid special register for builtin}}
99 unsigned long rsr64_4(void) {
100 return __builtin_arm_rsr64("0:1:2"); //expected-error {{invalid special register for builtin}}
103 unsigned long rsr64_5(void) {
104 return __builtin_arm_rsr64("cp0:8:c1"); //expected-error {{invalid special register for builtin}}
107 unsigned long rsr64_6(void) {
108 return __builtin_arm_rsr64("cp0:1:c16"); //expected-error {{invalid special register for builtin}}