2015-03-30 21:47:23 +08:00
|
|
|
// REQUIRES: mips-registered-target
|
2022-04-07 18:03:55 +08:00
|
|
|
// RUN: %clang_cc1 -no-opaque-pointers -triple mips-linux-gnu -emit-llvm -o - %s | FileCheck %s
|
2015-03-30 21:47:23 +08:00
|
|
|
|
|
|
|
int data;
|
|
|
|
|
|
|
|
void m () {
|
|
|
|
asm("lw $1, %0" :: "m"(data));
|
2022-01-05 22:16:24 +08:00
|
|
|
// CHECK: call void asm sideeffect "lw $$1, $0", "*m,~{$1}"(i32* elementtype(i32) @data)
|
2015-03-30 21:47:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void ZC () {
|
|
|
|
asm("ll $1, %0" :: "ZC"(data));
|
2022-01-05 22:16:24 +08:00
|
|
|
// CHECK: call void asm sideeffect "ll $$1, $0", "*^ZC,~{$1}"(i32* elementtype(i32) @data)
|
2015-03-30 21:47:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void R () {
|
|
|
|
asm("lw $1, %0" :: "R"(data));
|
2022-01-05 22:16:24 +08:00
|
|
|
// CHECK: call void asm sideeffect "lw $$1, $0", "*R,~{$1}"(i32* elementtype(i32) @data)
|
2015-03-30 21:47:23 +08:00
|
|
|
}
|
2016-03-29 20:46:16 +08:00
|
|
|
|
|
|
|
int additionalClobberedRegisters () {
|
|
|
|
int temp0;
|
|
|
|
asm volatile(
|
|
|
|
"mfhi %[temp0], $ac1 \n\t"
|
|
|
|
: [temp0]"=&r"(temp0)
|
|
|
|
:
|
|
|
|
: "memory", "t0", "t1", "$ac1hi", "$ac1lo", "$ac2hi", "$ac2lo", "$ac3hi", "$ac3lo"
|
|
|
|
);
|
|
|
|
return 0;
|
|
|
|
// CHECK: call i32 asm sideeffect "mfhi $0, $$ac1 \0A\09", "=&r,~{memory},~{$8},~{$9},~{$ac1hi},~{$ac1lo},~{$ac2hi},~{$ac2lo},~{$ac3hi},~{$ac3lo},~{$1}"
|
|
|
|
}
|