[cfe-commits] r134657 - in /cfe/trunk/test: CodeGen/asm.c Sema/asm.c
Eric Christopher
echristo at apple.com
Thu Jul 7 16:11:01 PDT 2011
Author: echristo
Date: Thu Jul 7 18:11:01 2011
New Revision: 134657
URL: http://llvm.org/viewvc/llvm-project?rev=134657&view=rev
Log:
Add a testcase for the previous commit and update an existing test for an
extra register.
Part of PR10299 and rdar://9740322
Modified:
cfe/trunk/test/CodeGen/asm.c
cfe/trunk/test/Sema/asm.c
Modified: cfe/trunk/test/CodeGen/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm.c?rev=134657&r1=134656&r2=134657&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/asm.c (original)
+++ cfe/trunk/test/CodeGen/asm.c Thu Jul 7 18:11:01 2011
@@ -49,10 +49,10 @@
// 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 @@
void t17() {
int i;
__asm__ ( "nop": "=m"(i));
-
+
// CHECK: @t17()
// CHECK: call void asm "nop", "=*m,
}
@@ -127,7 +127,7 @@
// <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 @@
// 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 @@
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 @@
"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" \
+ );
+}
Modified: cfe/trunk/test/Sema/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/asm.c?rev=134657&r1=134656&r2=134657&view=diff
==============================================================================
--- cfe/trunk/test/Sema/asm.c (original)
+++ cfe/trunk/test/Sema/asm.c Thu Jul 7 18:11:01 2011
@@ -5,7 +5,7 @@
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 @@
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 @@
// <rdar://problem/6512595>
void test5() {
- asm("nop" : : "X" (8));
+ asm("nop" : : "X" (8));
}
// PR3385
@@ -56,7 +56,7 @@
}
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 @@
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.
More information about the cfe-commits
mailing list