mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 05:06:06 +00:00

Conversion performed using the script at: https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34 These are only tests where no manual fixup was required.
27 lines
695 B
C
27 lines
695 B
C
// RUN: %clang_cc1 -triple mipsel-unknown-linux -o - -emit-llvm %s \
|
|
// RUN: | FileCheck %s
|
|
|
|
// This checks that the frontend will accept inline asm memory constraints.
|
|
|
|
int foo(void)
|
|
{
|
|
|
|
// 'R': An address that can be used in a non-macro load or stor'
|
|
// This test will result in the higher and lower nibbles being
|
|
// switched due to the lwl/lwr instruction pairs.
|
|
// CHECK: %{{[0-9]+}} = call i32 asm sideeffect "lwl $0, 1 + $1\0A\09lwr $0, 2 + $1\0A\09", "=r,*R,~{$1}"(ptr elementtype(i32) %{{[0-9,a-f]+}}) #1,
|
|
|
|
int c = 0xffbbccdd;
|
|
|
|
int *p = &c;
|
|
int out = 0;
|
|
|
|
__asm volatile (
|
|
"lwl %0, 1 + %1\n\t"
|
|
"lwr %0, 2 + %1\n\t"
|
|
: "=r"(out)
|
|
: "R"(*p)
|
|
);
|
|
return 0;
|
|
}
|