projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ed00af3
)
improve asm test
author
Matthias Braun
<matze@braunis.de>
Sun, 28 Oct 2007 12:30:51 +0000
(12:30 +0000)
committer
Matthias Braun
<matze@braunis.de>
Sun, 28 Oct 2007 12:30:51 +0000
(12:30 +0000)
[r16373]
ir/be/test/asm_test.c
patch
|
blob
|
history
diff --git
a/ir/be/test/asm_test.c
b/ir/be/test/asm_test.c
index
5d2df8c
..
d5fe607
100644
(file)
--- a/
ir/be/test/asm_test.c
+++ b/
ir/be/test/asm_test.c
@@
-1,4
+1,5
@@
#include <stdio.h>
#include <stdio.h>
+#include <assert.h>
#ifdef __i386__
static inline unsigned char inb(const unsigned short port)
#ifdef __i386__
static inline unsigned char inb(const unsigned short port)
@@
-54,11
+55,11
@@
typedef struct kernel_fd_set {
typedef int kernel_fd_set;
#endif
typedef int kernel_fd_set;
#endif
-void f
s
_set(int fd, kernel_fd_set* set) {
- __asm__("btsl %1,%0" : "=m" (*(set
+2
)) : "r" (fd));
+void f
d
_set(int fd, kernel_fd_set* set) {
+ __asm__("btsl %1,%0" : "=m" (*(set)) : "r" (fd));
}
}
-
void
fd_isset(int fd, kernel_fd_set *set) {
+
int
fd_isset(int fd, kernel_fd_set *set) {
unsigned char result;
__asm__ __volatile__("btl %1,%2\n"
unsigned char result;
__asm__ __volatile__("btl %1,%2\n"
@@
-77,13
+78,14
@@
int justcompile(void)
int main()
{
int main()
{
- //sincostest(0.5);
- /*outb(123, 42);
- outb(12345, 42);*/
+ kernel_fd_set s;
+
+ fd_set(20, &s);
+ assert(fd_isset(20, &s));
printf("Swap16: %d Swap32: %d\n", swap16(12), swap32(123551235));
printf("Swap16: %d Swap32: %d\n", swap16(12), swap32(123551235));
- return mov(0)
/*+ inb(12345) + inb(123)*/
;
+ return mov(0);
}
#else
}
#else