1 // REQUIRES: avr-registered-target
2 // RUN: %clang_cc1 -x c -triple avr -target-cpu at90s8515 -emit-llvm -o - %s \
3 // RUN: | FileCheck --check-prefixes=CHECK,AVR25 %s
4 // RUN: %clang_cc1 -x c -triple avr -target-cpu atmega328 -emit-llvm -o - %s \
5 // RUN: | FileCheck --check-prefixes=CHECK,AVR51 %s
6 // RUN: %clang_cc1 -x c -triple avr -target-cpu atmega2560 -emit-llvm -o - %s \
7 // RUN: | FileCheck --check-prefixes=CHECK,AVR6 %s
12 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "a"(i16 %0)
13 asm("add r5, %0" :: "a"(data
));
17 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "b"(i16 %0)
18 asm("add r5, %0" :: "b"(data
));
22 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "d"(i16 %0)
23 asm("add r5, %0" :: "d"(data
));
27 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "l"(i16 %0)
28 asm("add r5, %0" :: "l"(data
));
32 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "e"(i16 %0)
33 asm("add r5, %0" :: "e"(data
));
37 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "q"(i16 %0)
38 asm("add r5, %0" :: "q"(data
));
42 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "r"(i16 %0)
43 asm("add r5, %0" :: "r"(data
));
47 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "w"(i16 %0)
48 asm("add r5, %0" :: "w"(data
));
52 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "t"(i16 %0)
53 asm("add r5, %0" :: "t"(data
));
57 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "x"(i16 %0)
58 asm("add r5, %0" :: "x"(data
));
62 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "y"(i16 %0)
63 asm("add r5, %0" :: "y"(data
));
67 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "z"(i16 %0)
68 asm("add r5, %0" :: "z"(data
));
72 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "I"(i16 50)
73 asm("subi r30, %0" :: "I"(50));
77 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "J"(i16 -50)
78 asm("subi r30, %0" :: "J"(-50));
82 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "K"(i16 2)
83 asm("subi r30, %0" :: "K"(2));
87 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "L"(i16 0)
88 asm("subi r30, %0" :: "L"(0));
92 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "M"(i16 255)
93 asm("subi r30, %0" :: "M"(255));
97 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "O"(i16 16)
98 asm("subi r30, %0" :: "O"(16));
102 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "P"(i16 1)
103 asm("subi r30, %0" :: "P"(1));
107 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "R"(i16 -3)
108 asm("subi r30, %0" :: "R"(-3));
112 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "G"(i16 0)
113 asm("subi r30, %0" :: "G"(0));
117 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "Q"(i16 50)
118 asm("subi r30, %0" :: "Q"(50));
122 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "ra"(i16 50)
123 asm("subi r30, %0" :: "ra"(50));
127 // CHECK: call addrspace(0) i16 asm "subi r30, $0", "=ra"()
128 asm("subi r30, %0" : "=ra"(data
));
131 void escapeChar(void) {
133 // AVR25: call addrspace(0) void asm sideeffect "rcall _foo"
134 // AVR51: call addrspace(0) void asm sideeffect "call _foo"
135 // AVR6: call addrspace(0) void asm sideeffect "call _foo"
136 asm("%~call _foo" ::);
137 // AVR25: call addrspace(0) void asm sideeffect "rjmp _foo"
138 // AVR51: call addrspace(0) void asm sideeffect "jmp _foo"
139 // AVR6: call addrspace(0) void asm sideeffect "jmp _foo"
140 asm("%~jmp _foo" ::);
141 // AVR25: call addrspace(0) void asm sideeffect "icall"
142 // AVR51: call addrspace(0) void asm sideeffect "icall"
143 // AVR6: call addrspace(0) void asm sideeffect "eicall"
145 // AVR25: call addrspace(0) void asm sideeffect "ijmp"
146 // AVR51: call addrspace(0) void asm sideeffect "ijmp"
147 // AVR6: call addrspace(0) void asm sideeffect "eijmp"