avr-inline-asm-constraints.c
3.04 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// REQUIRES: avr-registered-target
// RUN: %clang_cc1 -triple avr-unknown-unknown -emit-llvm -o - %s | FileCheck %s
int data;
void a() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "a"(i16 %0)
asm("add r5, %0" :: "a"(data));
}
void b() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "b"(i16 %0)
asm("add r5, %0" :: "b"(data));
}
void d() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "d"(i16 %0)
asm("add r5, %0" :: "d"(data));
}
void l() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "l"(i16 %0)
asm("add r5, %0" :: "l"(data));
}
void e() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "e"(i16 %0)
asm("add r5, %0" :: "e"(data));
}
void q() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "q"(i16 %0)
asm("add r5, %0" :: "q"(data));
}
void r() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "r"(i16 %0)
asm("add r5, %0" :: "r"(data));
}
void w() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "w"(i16 %0)
asm("add r5, %0" :: "w"(data));
}
void t() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "t"(i16 %0)
asm("add r5, %0" :: "t"(data));
}
void x() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "x"(i16 %0)
asm("add r5, %0" :: "x"(data));
}
void y() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "y"(i16 %0)
asm("add r5, %0" :: "y"(data));
}
void z() {
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "z"(i16 %0)
asm("add r5, %0" :: "z"(data));
}
void I() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "I"(i16 50)
asm("subi r30, %0" :: "I"(50));
}
void J() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "J"(i16 -50)
asm("subi r30, %0" :: "J"(-50));
}
void K() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "K"(i16 2)
asm("subi r30, %0" :: "K"(2));
}
void L() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "L"(i16 0)
asm("subi r30, %0" :: "L"(0));
}
void M() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "M"(i16 255)
asm("subi r30, %0" :: "M"(255));
}
void O() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "O"(i16 16)
asm("subi r30, %0" :: "O"(16));
}
void P() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "P"(i16 1)
asm("subi r30, %0" :: "P"(1));
}
void R() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "R"(i16 -3)
asm("subi r30, %0" :: "R"(-3));
}
void G() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "G"(i16 50)
asm("subi r30, %0" :: "G"(50));
}
void Q() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "Q"(i16 50)
asm("subi r30, %0" :: "Q"(50));
}
void ra() {
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "ra"(i16 50)
asm("subi r30, %0" :: "ra"(50));
}
void ora() {
// CHECK: call addrspace(0) i16 asm "subi r30, $0", "=ra"()
asm("subi r30, %0" : "=ra"(data));
}