• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify -triple aarch64 %s
2 
string_literal(unsigned v)3 void string_literal(unsigned v) {
4   __builtin_arm_wsr(0, v); // expected-error {{expression is not a string literal}}
5 }
6 
wsr_1(unsigned v)7 void wsr_1(unsigned v) {
8   __builtin_arm_wsr("sysreg", v);
9 }
10 
wsrp_1(void * v)11 void wsrp_1(void *v) {
12   __builtin_arm_wsrp("sysreg", v);
13 }
14 
wsr64_1(unsigned long v)15 void wsr64_1(unsigned long v) {
16   __builtin_arm_wsr64("sysreg", v);
17 }
18 
rsr_1()19 unsigned rsr_1() {
20   return __builtin_arm_rsr("sysreg");
21 }
22 
rsrp_1()23 void *rsrp_1() {
24   return __builtin_arm_rsrp("sysreg");
25 }
26 
rsr64_1()27 unsigned long rsr64_1() {
28   return __builtin_arm_rsr64("sysreg");
29 }
30 
wsr_2(unsigned v)31 void wsr_2(unsigned v) {
32   __builtin_arm_wsr("0:1:2:3:4", v);
33 }
34 
wsrp_2(void * v)35 void wsrp_2(void *v) {
36   __builtin_arm_wsrp("0:1:2:3:4", v);
37 }
38 
wsr64_2(unsigned long v)39 void wsr64_2(unsigned long v) {
40   __builtin_arm_wsr64("0:1:2:3:4", v);
41 }
42 
rsr_2()43 unsigned rsr_2() {
44   return __builtin_arm_rsr("0:1:15:15:4");
45 }
46 
rsrp_2()47 void *rsrp_2() {
48   return __builtin_arm_rsrp("0:1:2:3:4");
49 }
50 
rsr64_2()51 unsigned long rsr64_2() {
52   return __builtin_arm_rsr64("0:1:15:15:4");
53 }
54 
wsr_3(unsigned v)55 void wsr_3(unsigned v) {
56   __builtin_arm_wsr("0:1:2", v); //expected-error {{invalid special register for builtin}}
57 }
58 
wsrp_3(void * v)59 void wsrp_3(void *v) {
60   __builtin_arm_wsrp("0:1:2", v); //expected-error {{invalid special register for builtin}}
61 }
62 
wsr64_3(unsigned long v)63 void wsr64_3(unsigned long v) {
64   __builtin_arm_wsr64("0:1:2", v); //expected-error {{invalid special register for builtin}}
65 }
66 
rsr_3()67 unsigned rsr_3() {
68   return __builtin_arm_rsr("0:1:2"); //expected-error {{invalid special register for builtin}}
69 }
70 
rsr_4()71 unsigned rsr_4() {
72   return __builtin_arm_rsr("0:1:2:3:8"); //expected-error {{invalid special register for builtin}}
73 }
74 
rsr_5()75 unsigned rsr_5() {
76   return __builtin_arm_rsr("0:8:1:2:3"); //expected-error {{invalid special register for builtin}}
77 }
78 
rsr_6()79 unsigned rsr_6() {
80   return __builtin_arm_rsr("0:1:16:16:2"); //expected-error {{invalid special register for builtin}}
81 }
82 
rsrp_3()83 void *rsrp_3() {
84   return __builtin_arm_rsrp("0:1:2"); //expected-error {{invalid special register for builtin}}
85 }
86 
rsr64_3()87 unsigned long rsr64_3() {
88   return __builtin_arm_rsr64("0:1:2"); //expected-error {{invalid special register for builtin}}
89 }
90 
rsr64_4()91 unsigned long rsr64_4() {
92   return __builtin_arm_rsr64("0:1:2:3:8"); //expected-error {{invalid special register for builtin}}
93 }
94 
rsr64_5()95 unsigned long rsr64_5() {
96   return __builtin_arm_rsr64("0:8:2:3:4"); //expected-error {{invalid special register for builtin}}
97 }
98 
rsr64_6()99 unsigned long rsr64_6() {
100   return __builtin_arm_rsr64("0:1:16:16:2"); //expected-error {{invalid special register for builtin}}
101 }
102