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
df3c852e
Commit
df3c852e
authored
Sep 13, 2007
by
Michael Beck
Browse files
more test added
[r15792]
parent
cb024ed4
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/test/localopts.c
View file @
df3c852e
...
...
@@ -43,6 +43,10 @@ int sub3(int x, int y)
return
-
x
-
y
;
}
int
sub4
(
int
x
)
{
return
6
-
~
x
;
}
int
cmp1
(
int
x
,
int
y
)
{
return
-
x
==
-
y
;
}
...
...
@@ -83,6 +87,18 @@ int cmp10(int x) {
return
-
x
!=
3
;
}
int
and1
(
int
a
,
int
b
)
{
return
(
a
|
b
)
&
a
;
}
int
and2
(
int
a
,
int
b
)
{
return
(
a
|
b
)
&
~
(
a
&
b
);
}
int
add1
(
int
x
)
{
return
x
+
~
x
;
}
int
main
(
void
)
{
#define TU(func,x,expect) \
...
...
@@ -100,6 +116,7 @@ int main(void)
TB
(
sub1
,
23
,
17
,
-
691
);
TB
(
sub2
,
42
,
17
,
59
);
TB
(
sub3
,
42
,
17
,
-
59
);
TU
(
sub4
,
42
,
49
);
TB
(
cmp1
,
42
,
17
,
0
);
TB
(
cmp2
,
42
,
17
,
1
);
TB
(
cmp3
,
42
,
17
,
0
);
...
...
@@ -110,4 +127,7 @@ int main(void)
TT
(
cmp8
,
42
,
17
,
-
4
,
1
);
TU
(
cmp9
,
-
3
,
1
);
TU
(
cmp10
,
-
3
,
0
);
TB
(
and1
,
42
,
17
,
42
);
TB
(
and2
,
42
,
17
,
42
^
17
);
TU
(
add1
,
-
3
,
-
1
);
}
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