summaryrefslogtreecommitdiff
path: root/test/Sema/arm-special-register.c
blob: 3ded628c137d41986d91fe033f773f06fcdded1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify -triple arm %s

void string_literal(unsigned v) {
  __builtin_arm_wsr(0, v); // expected-error {{expression is not a string literal}}
}

void wsr_1(unsigned v) {
  __builtin_arm_wsr("sysreg", v);
}

void wsrp_1(void *v) {
  __builtin_arm_wsrp("sysreg", v);
}

void wsr64_1(unsigned long v) {
  __builtin_arm_wsr64("sysreg", v); //expected-error {{invalid special register for builtin}}
}

unsigned rsr_1() {
  return __builtin_arm_rsr("sysreg");
}

void *rsrp_1() {
  return __builtin_arm_rsrp("sysreg");
}

unsigned long rsr64_1() {
  return __builtin_arm_rsr64("sysreg"); //expected-error {{invalid special register for builtin}}
}

void wsr_2(unsigned v) {
  __builtin_arm_wsr("cp0:1:c2:c3:4", v);
}

void wsrp_2(void *v) {
  __builtin_arm_wsrp("cp0:1:c2:c3:4", v);
}

void wsr64_2(unsigned long v) {
  __builtin_arm_wsr64("cp0:1:c2:c3:4", v); //expected-error {{invalid special register for builtin}}
}

unsigned rsr_2() {
  return __builtin_arm_rsr("cp0:1:c2:c3:4");
}

void *rsrp_2() {
  return __builtin_arm_rsrp("cp0:1:c2:c3:4");
}

unsigned long rsr64_2() {
  return __builtin_arm_rsr64("cp0:1:c2:c3:4"); //expected-error {{invalid special register for builtin}}
}

void wsr_3(unsigned v) {
  __builtin_arm_wsr("cp0:1:c2", v); //expected-error {{invalid special register for builtin}}
}

void wsrp_3(void *v) {
  __builtin_arm_wsrp("cp0:1:c2", v); //expected-error {{invalid special register for builtin}}
}

void wsr64_3(unsigned long v) {
  __builtin_arm_wsr64("cp0:1:c2", v);
}

unsigned rsr_3() {
  return __builtin_arm_rsr("cp0:1:c2"); //expected-error {{invalid special register for builtin}}
}

void *rsrp_3() {
  return __builtin_arm_rsrp("cp0:1:c2"); //expected-error {{invalid special register for builtin}}
}

unsigned long rsr64_3() {
  return __builtin_arm_rsr64("cp0:1:c2");
}

unsigned rsr_4() {
  return __builtin_arm_rsr("0:1:2:3:4"); //expected-error {{invalid special register for builtin}}
}

void *rsrp_4() {
  return __builtin_arm_rsrp("0:1:2:3:4"); //expected-error {{invalid special register for builtin}}
}

unsigned long rsr64_4() {
  return __builtin_arm_rsr64("0:1:2"); //expected-error {{invalid special register for builtin}}
}