2017-02-06 17:01:59 +08:00
|
|
|
// REQUIRES: avr-registered-target
|
|
|
|
// RUN: %clang_cc1 -triple avr-unknown-unknown -emit-llvm -o - %s | FileCheck %s
|
|
|
|
|
|
|
|
int data;
|
|
|
|
|
|
|
|
void a() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "a"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "a"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void b() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "b"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "b"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void d() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "d"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "d"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void l() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "l"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "l"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void e() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "e"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "e"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void q() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "q"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "q"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void r() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "r"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "r"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void w() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "w"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "w"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void t() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "t"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "t"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void x() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "x"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "x"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void y() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "y"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "y"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void z() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "add r5, $0", "z"(i16 %0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("add r5, %0" :: "z"(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
void I() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "I"(i16 50)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "I"(50));
|
|
|
|
}
|
|
|
|
|
|
|
|
void J() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "J"(i16 -50)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "J"(-50));
|
|
|
|
}
|
|
|
|
|
|
|
|
void K() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "K"(i16 2)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "K"(2));
|
|
|
|
}
|
|
|
|
|
|
|
|
void L() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "L"(i16 0)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "L"(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
void M() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "M"(i16 255)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "M"(255));
|
|
|
|
}
|
|
|
|
|
|
|
|
void O() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "O"(i16 16)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "O"(16));
|
|
|
|
}
|
|
|
|
|
|
|
|
void P() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "P"(i16 1)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "P"(1));
|
|
|
|
}
|
|
|
|
|
|
|
|
void R() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "R"(i16 -3)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "R"(-3));
|
|
|
|
}
|
|
|
|
|
|
|
|
void G() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "G"(i16 50)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "G"(50));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Q() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "Q"(i16 50)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "Q"(50));
|
|
|
|
}
|
|
|
|
|
|
|
|
void ra() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) void asm sideeffect "subi r30, $0", "ra"(i16 50)
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" :: "ra"(50));
|
|
|
|
}
|
|
|
|
|
|
|
|
void ora() {
|
2018-08-24 12:45:04 +08:00
|
|
|
// CHECK: call addrspace(0) i16 asm "subi r30, $0", "=ra"()
|
2017-02-06 17:01:59 +08:00
|
|
|
asm("subi r30, %0" : "=ra"(data));
|
|
|
|
}
|