projects
/
libfirm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
testcase for new Confirm code
[libfirm]
/
ir
/
be
/
test
/
confirm.c
1
#include <stdio.h>
2
3
int test(int a, int b) {
4
int x = a * b;
5
if (a == 0)
6
return x;
7
else
8
return x - 1;
9
}
10
11
static int abs(int x) {
12
if (x < 0)
13
return -x;
14
return x;
15
}
16
17
int test2(int a, int b) {
18
if (a > 0) {
19
return abs(a);
20
}
21
return b;
22
}
23
24
int test3(int a, int b) {
25
if (a != 0) {
26
b = b / -a;
27
}
28
return b;
29
}
30
31
int main(void) {
32
printf("test() = %d\n", test(0, 1));
33
printf("test() = %d\n", test2(1, 3));
34
printf("test() = %d\n", test3(-3, 3));
35
return 0;
36
}