Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
bebba467
Commit
bebba467
authored
Jul 28, 2008
by
Matthias Braun
Browse files
add an asm test with an inout parameter
[r20734]
parent
65bee870
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/test/asm_test.c
View file @
bebba467
...
...
@@ -46,6 +46,11 @@ static inline unsigned int swap32(unsigned int x)
return
x
;
}
static
inline
void
inc
(
int
*
v
)
{
__asm__
(
"incl %0"
:
"+g"
(
*
v
)
:
:
"cc"
);
}
#if 1
typedef
struct
kernel_fd_set
{
int
bla
;
...
...
@@ -79,11 +84,16 @@ int justcompile(void)
int
main
()
{
kernel_fd_set
s
;
int
k
;
fd_set
(
20
,
&
s
);
assert
(
fd_isset
(
20
,
&
s
));
printf
(
"Swap16: %d Swap32: %d
\n
"
,
swap16
(
12
),
swap32
(
123551235
));
printf
(
"Swap16(0xAABB): %X Swap32(0xAABBCCDD): %X
\n
"
,
swap16
(
0xAABB
),
swap32
(
0xAABBCCDD
));
k
=
41
;
inc
(
&
k
);
printf
(
"mov(inc(41)): %d
\n
"
,
mov
(
k
));
return
mov
(
0
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment