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
0c431a4d
Commit
0c431a4d
authored
Jul 02, 2007
by
Matthias Braun
Browse files
fixed lots of warnings in testprograms
[r14882]
parent
7c0c1e1e
Changes
38
Hide whitespace changes
Inline
Side-by-side
ir/be/test/Arrays.c
View file @
0c431a4d
#include
<stdio.h>
#include
<string.h>
struct
Arr2Object
{
int
a
[
10
];
...
...
@@ -36,7 +37,6 @@ static void pass_array_test(struct ArrObject *a, int a_len)
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
,
j
,
bi
;
struct
ArrObject
ao
[
10
];
struct
ArrObject
aob
;
struct
Arr2Object
a2o
[
2
];
struct
Arr2Object
a2
;
...
...
ir/be/test/Field.c
View file @
0c431a4d
...
...
@@ -2,7 +2,7 @@
* $Id$
*/
//
#include <stdio.h>
#include
<stdio.h>
struct
s
{
int
a
;
...
...
ir/be/test/ForTest.c
View file @
0c431a4d
...
...
@@ -12,19 +12,8 @@ typedef int boolean;
#define true 1
#define false 0
static
void
piff
(
void
)
{
int
i
,
j
,
x
,
delta_x
;
delta_x
=
2
;
j
=
0
;
x
=
0
;
for
(
i
=
0
,
x
=
0
;
i
<
1000
;
i
++
,
x
+=
delta_x
)
{
j
+=
x
;
}
}
static
int
simpleloop
(
int
a
,
int
b
)
{
int
i
,
j
,
delta_x
,
x
;
int
i
,
j
;
boolean
loopfinal
=
true
;
for
(
i
=
0
;
(
i
<
10
)
&&
loopfinal
;
i
++
)
{
...
...
@@ -43,8 +32,6 @@ static int simpleloop (int a, int b) {
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
,
j
;
printf
(
"ForTest.c
\n
"
);
simpleloop
(
3
,
10
);
...
...
ir/be/test/GlobalCseTest.c
View file @
0c431a4d
...
...
@@ -4,6 +4,7 @@
// $Id$
//
// Testprogram to test GCC-firm : GlobalCseTest.c
#include
<stdio.h>
int
m
(
int
a
)
{
int
b
;
...
...
ir/be/test/HeapSort.c
View file @
0c431a4d
...
...
@@ -107,7 +107,7 @@ void heapaufbau2(int *a, int *b, int len) {
* Heap-Methoden und gibt das sortierte Feld zurck.
*/
int
*
heapsort
(
int
*
b
,
int
len
)
{
int
i
,
k
;
int
k
;
int
*
c
;
int
*
a
;
...
...
ir/be/test/Local.c
View file @
0c431a4d
#include
<stdio.h>
//
// GCC-firm Project
//
...
...
ir/be/test/Pdg.c
View file @
0c431a4d
...
...
@@ -12,6 +12,7 @@ int main(int argc, char *argv[]) {
printf
(
"Pdg.c
\n
"
);
i
=
1
;
k
=
0
;
while
(
i
<
10
)
{
j
=
i
+
1
;
if
(
j
==
7
)
...
...
@@ -21,5 +22,6 @@ int main(int argc, char *argv[]) {
i
=
i
+
1
;
}
(
void
)
k
;
return
0
;
}
ir/be/test/Queens.c
View file @
0c431a4d
...
...
@@ -38,43 +38,48 @@ boolean place_ok (int i) {
int
j
=
0
;
boolean
res
;
printf
(
"POK: %d
\n
"
,
i
);
while
(
j
<
i
)
{
if
((
row
[
j
]
==
row
[
i
])
||
((
myabs
(
row
[
i
]
-
row
[
j
]))
==
(
i
-
j
)))
{
printf
(
"F
\n
"
);
res
=
false
;
return
(
res
);
}
j
=
j
+
1
;
}
printf
(
"T
\n
"
);
res
=
true
;
return
(
res
);
}
int
solve
(
int
n
)
{
// return the number of solutions to the n-queens problem
int
c
=
0
;
int
res
=
0
;
row
=
(
void
*
)
malloc
(
sizeof
(
*
row
)
*
n
);
row
[
0
]
=
-
1
;
while
(
c
>=
0
)
{
row
[
c
]
=
row
[
c
]
+
1
;
while
((
row
[
c
]
<
n
)
&&
(
!
place_ok
(
c
)))
{
row
[
c
]
=
row
[
c
]
+
1
;
}
if
(
row
[
c
]
<
n
)
{
// successfully placed at (c,row[c])
if
(
c
==
n
-
1
)
res
=
res
+
1
;
else
{
c
=
c
+
1
;
row
[
c
]
=
-
1
;
}
}
else
// dead end, track back
c
=
c
-
1
;
}
free
(
row
);
return
(
res
);
// return the number of solutions to the n-queens problem
int
c
=
0
;
int
res
=
0
;
row
=
(
void
*
)
malloc
(
sizeof
(
*
row
)
*
n
);
row
[
0
]
=
-
1
;
while
(
c
>=
0
)
{
row
[
c
]
=
row
[
c
]
+
1
;
while
((
row
[
c
]
<
n
)
&&
(
!
place_ok
(
c
)))
{
row
[
c
]
=
row
[
c
]
+
1
;
}
printf
(
"RC: %d
\n
"
,
row
[
c
]);
if
(
row
[
c
]
<
n
)
{
// successfully placed at (c,row[c])
if
(
c
==
n
-
1
)
res
=
res
+
1
;
else
{
c
=
c
+
1
;
row
[
c
]
=
-
1
;
}
}
else
// dead end, track back
c
=
c
-
1
;
}
free
(
row
);
return
(
res
);
}
static
void
usage
(
const
char
*
progname
)
{
...
...
ir/be/test/Sieve.c
View file @
0c431a4d
...
...
@@ -28,7 +28,7 @@ static void mark_count(int c) {
static
void
runSieve
(
void
)
{
int
ITERATIONS
=
100000
;
boolean
*
flags
;
int
i
,
prime
,
k
,
iter
,
p
;
int
i
,
prime
,
k
;
int
iterations
=
0
;
int
count
;
...
...
@@ -58,8 +58,6 @@ static void runSieve(void) {
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
;
printf
(
"Sieve.c
\n
"
);
if
(
argc
<=
1
)
{
...
...
ir/be/test/Switcher.c
View file @
0c431a4d
...
...
@@ -15,10 +15,6 @@ static void print_int(int i) {
printf
(
" %d
\n
"
,
i
);
}
static
int
id
(
int
i
)
{
return
(
i
);
}
// standard switch with 1 case
static
void
switch1
(
int
i
)
{
switch
(
i
)
{
...
...
@@ -141,13 +137,14 @@ static void double_switch(int i) {
int
main
(
int
argc
,
char
*
argv
[])
{
printf
(
"Switcher.c
\n
"
);
printf
(
" must print:
\n
0
\n
2
\n
0
\n
3
\n
-1
\n
2
\n
is 16
\n
multiple of 4
\n\n
"
);
printf
(
" must print:
\n
0
\n
2
\n
0
\n
3
\n
-1
\n
2
\n
5
\n
is 16
\n
multiple of 4
\n\n
"
);
switch1
(
0
);
switch2
(
2
);
switch3
(
0
);
switch4
(
5
);
switch5
(
0
);
switch6
(
2
);
switch7
(
3
);
double_switch
(
16
);
return
0
;
...
...
ir/be/test/ack/t7.c
View file @
0c431a4d
...
...
@@ -135,6 +135,7 @@ int n;
itoa
(
t
,
cht
);
write
(
1
,
cht
,
strlen
(
cht
));
write
(
1
,
pp6
,
strlen
(
pp6
));
abort
();
}
...
...
ir/be/test/arr_init.c
View file @
0c431a4d
#include
<stdio.h>
int
arr0
[]
=
{
0
,
1
,
2
,
3
};
int
arr1
[
4
]
=
{
3
,
2
,
1
};
int
arrm
[
3
][
4
]
=
{
{
1
},
{
2
,
3
,
4
,
5
},
{
6
,
7
,
8
}
};
...
...
ir/be/test/array_type.c
View file @
0c431a4d
#include
<stdio.h>
int
foo
[
255
][
4
];
int
bar
[
4
]
=
{
0
,
1
,
2
,
3
};
...
...
ir/be/test/bitfield.c
View file @
0c431a4d
#include
<stdio.h>
struct
a
{
unsigned
int
i
:
1
;
};
...
...
ir/be/test/compress95.c
View file @
0c431a4d
...
...
@@ -202,6 +202,7 @@ static char rcs_ident[] = "$Header$";
#include
<stdio.h>
#include
<ctype.h>
#include
<stdlib.h>
#ifdef VMS
#include
<types.h>
#include
<stat.h>
...
...
@@ -355,8 +356,7 @@ unsigned char *OutBuff;
spec_select_action
(
char
*
from_buf
,
int
from_count
,
int
action
,
char
*
to_buf
)
{
char
*
cp
,
*
rindex
(),
*
malloc
();
struct
stat
statbuf
;
char
*
rindex
();
#ifdef SYSV
void
onintr
(),
oops
();
#else
...
...
ir/be/test/convtest.c
View file @
0c431a4d
...
...
@@ -12,7 +12,7 @@ int convtest_func(char c, short s, int i, float f, double d) {
short
is
=
s
+
i
;
short
fs
=
s
+
f
;
short
ds
=
s
+
d
;
int
ti
=
i
+
s
;
//
int ti = i + s;
int
fi
=
i
+
f
;
int
di
=
i
+
d
;
float
df
=
d
+
f
;
...
...
ir/be/test/dblstruct.c
View file @
0c431a4d
#include
<stdio.h>
typedef
struct
TypeToken
{
int
Handle
;
...
...
ir/be/test/fehler10.c
View file @
0c431a4d
#include
<stdio.h>
void
a
(
void
);
void
b
(
void
);
...
...
ir/be/test/fehler11.c
View file @
0c431a4d
#include
<stdio.h>
int
main
(
void
)
{
long
long
a
=
0x0123456789012345
;
...
...
ir/be/test/fehler14.c
View file @
0c431a4d
#include
<stdio.h>
unsigned
int
c
=
0xffffffff
;
unsigned
short
b
;
...
...
Prev
1
2
Next
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