[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / avr / avr-inline-asm-constraints.c
blob3a956de8db48f083290b89f193706696574bfdd8
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
9 int data;
11 void a() {
12 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "a"(i16 %0)
13 asm("add r5, %0" :: "a"(data));
16 void b() {
17 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "b"(i16 %0)
18 asm("add r5, %0" :: "b"(data));
21 void d() {
22 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "d"(i16 %0)
23 asm("add r5, %0" :: "d"(data));
26 void l() {
27 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "l"(i16 %0)
28 asm("add r5, %0" :: "l"(data));
31 void e() {
32 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "e"(i16 %0)
33 asm("add r5, %0" :: "e"(data));
36 void q() {
37 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "q"(i16 %0)
38 asm("add r5, %0" :: "q"(data));
41 void r() {
42 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "r"(i16 %0)
43 asm("add r5, %0" :: "r"(data));
46 void w() {
47 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "w"(i16 %0)
48 asm("add r5, %0" :: "w"(data));
51 void t() {
52 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "t"(i16 %0)
53 asm("add r5, %0" :: "t"(data));
56 void x() {
57 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "x"(i16 %0)
58 asm("add r5, %0" :: "x"(data));
61 void y() {
62 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "y"(i16 %0)
63 asm("add r5, %0" :: "y"(data));
66 void z() {
67 // CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "z"(i16 %0)
68 asm("add r5, %0" :: "z"(data));
71 void I() {
72 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "I"(i16 50)
73 asm("subi r30, %0" :: "I"(50));
76 void J() {
77 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "J"(i16 -50)
78 asm("subi r30, %0" :: "J"(-50));
81 void K() {
82 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "K"(i16 2)
83 asm("subi r30, %0" :: "K"(2));
86 void L() {
87 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "L"(i16 0)
88 asm("subi r30, %0" :: "L"(0));
91 void M() {
92 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "M"(i16 255)
93 asm("subi r30, %0" :: "M"(255));
96 void O() {
97 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "O"(i16 16)
98 asm("subi r30, %0" :: "O"(16));
101 void P() {
102 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "P"(i16 1)
103 asm("subi r30, %0" :: "P"(1));
106 void R() {
107 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "R"(i16 -3)
108 asm("subi r30, %0" :: "R"(-3));
111 void G() {
112 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "G"(i16 0)
113 asm("subi r30, %0" :: "G"(0));
116 void Q() {
117 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "Q"(i16 50)
118 asm("subi r30, %0" :: "Q"(50));
121 void ra() {
122 // CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "ra"(i16 50)
123 asm("subi r30, %0" :: "ra"(50));
126 void ora() {
127 // CHECK: call addrspace(0) i16 asm "subi r30, $0", "=ra"()
128 asm("subi r30, %0" : "=ra"(data));
131 void escapeChar(void) {
132 asm("_foo:");
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"
144 asm("%!icall" ::);
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"
148 asm("%!ijmp" ::);