Add a testcase for the previous commit and update an existing test for an

extra register.

Part of PR10299 and rdar://9740322

llvm-svn: 134657
This commit is contained in:
Eric Christopher 2011-07-07 23:11:01 +00:00
parent c6466fc9ab
commit f7d303c541
2 changed files with 25 additions and 11 deletions

View File

@ -49,10 +49,10 @@ unsigned t9(unsigned int a) {
// PR3908
void t10(int r) {
__asm__("PR3908 %[lf] %[xx] %[li] %[r]" : [r] "+r" (r) : [lf] "mx" (0), [li] "mr" (0), [xx] "x" ((double)(0)));
// CHECK: @t10(
// CHECK:PR3908 $1 $3 $2 $0
}
}
// PR3373
@ -119,7 +119,7 @@ int t16() {
void t17() {
int i;
__asm__ ( "nop": "=m"(i));
// CHECK: @t17()
// CHECK: call void asm "nop", "=*m,
}
@ -127,7 +127,7 @@ void t17() {
// <rdar://problem/6841383>
int t18(unsigned data) {
int a, b;
asm("xyz" :"=a"(a), "=d"(b) : "a"(data));
return a + b;
// CHECK: t18(i32
@ -140,7 +140,7 @@ int t18(unsigned data) {
// PR6780
int t19(unsigned data) {
int a, b;
asm("x{abc|def|ghi}z" :"=r"(a): "r"(data));
return a + b;
// CHECK: t19(i32
@ -153,7 +153,7 @@ double t20(double x) {
register long double result;
__asm __volatile ("frndint" : "=t" (result) : "0" (x));
return result;
// CHECK: @t20
// CHECK: fpext double {{.*}} to x86_fp80
// CHECK-NEXT: call x86_fp80 asm sideeffect "frndint"
@ -190,3 +190,17 @@ unsigned char t23(unsigned char a, unsigned char b) {
"edx", "cc");
return res;
}
// PR10299 - fpsr, fpcr
void test(void)
{
__asm__ __volatile__( \
"finit" \
: \
: \
:"st","st(1)","st(2)","st(3)", \
"st(4)","st(5)","st(6)","st(7)", \
"fpsr","fpcr" \
);
}

View File

@ -5,7 +5,7 @@ void f() {
asm ("foo\n" : : "a" (i + 2));
asm ("foo\n" : : "a" (f())); // expected-error {{invalid type 'void' in asm input}}
asm ("foo\n" : "=a" (f())); // expected-error {{invalid lvalue in asm output}}
asm ("foo\n" : "=a" (i + 2)); // expected-error {{invalid lvalue in asm output}}
@ -21,7 +21,7 @@ void clobbers() {
asm ("nop" : : : "0", "%0", "#0");
asm ("nop" : : : "foo"); // expected-error {{unknown register name 'foo' in asm}}
asm ("nop" : : : "52");
asm ("nop" : : : "53"); // expected-error {{unknown register name '53' in asm}}
asm ("nop" : : : "54"); // expected-error {{unknown register name '54' in asm}}
asm ("nop" : : : "-1"); // expected-error {{unknown register name '-1' in asm}}
asm ("nop" : : : "+1"); // expected-error {{unknown register name '+1' in asm}}
}
@ -47,7 +47,7 @@ void test4(const volatile void *addr)
// <rdar://problem/6512595>
void test5() {
asm("nop" : : "X" (8));
asm("nop" : : "X" (8));
}
// PR3385
@ -56,7 +56,7 @@ void test6(long i) {
}
void asm_string_tests(int i) {
asm("%!"); // simple asm string, %! is not an error.
asm("%!"); // simple asm string, %! is not an error.
asm("%!" : ); // expected-error {{invalid % escape in inline assembly string}}
asm("xyz %" : ); // expected-error {{invalid % escape in inline assembly string}}
@ -64,7 +64,7 @@ void asm_string_tests(int i) {
asm ("%[somename]" :: "i"(4)); // expected-error {{unknown symbolic operand name in inline assembly string}}
asm ("%[somename" :: "i"(4)); // expected-error {{unterminated symbolic operand name in inline assembly string}}
asm ("%[]" :: "i"(4)); // expected-error {{empty symbolic operand name in inline assembly string}}
// PR3258
asm("%9" :: "i"(4)); // expected-error {{invalid operand number in inline asm string}}
asm("%1" : "+r"(i)); // ok, referring to input.