diff options
-rw-r--r-- | test/CodeGen/asm.c | 26 | ||||
-rw-r--r-- | test/Sema/asm.c | 10 |
2 files changed, 25 insertions, 11 deletions
diff --git a/test/CodeGen/asm.c b/test/CodeGen/asm.c index eb11285871..7199f09e1a 100644 --- a/test/CodeGen/asm.c +++ b/test/CodeGen/asm.c @@ -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" \ + ); +} diff --git a/test/Sema/asm.c b/test/Sema/asm.c index f1c24c8fb6..359431c4f9 100644 --- a/test/Sema/asm.c +++ b/test/Sema/asm.c @@ -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. |