repo.or.cz
/
sdcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
gcc-torture-execute-960327-1.c
blob
405d3726cd8f1fc7c749fc6ecfc19d074fb30b2f
1
/*
2
960327-1.c from the execute part of the gcc torture suite.
3
*/
4
5
#include <testfwk.h>
6
7
#ifdef __SDCC
8
#pragma std_c99
9
#endif
10
11
#include <stdio.h>
12
int
13
g
(
void
)
14
{
15
return
'
\n
'
;
16
}
17
18
void
f
()
19
{
20
#if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
// Lack of memory
21
char
s
[] =
"abcedfg012345"
;
22
char
*
sp
=
s
+
12
;
23
24
switch
(
g
())
25
{
26
case
'
\n
'
:
27
break
;
28
}
29
30
while
(*--
sp
==
'0'
)
31
;
32
sprintf
(
sp
+
1
,
"X"
);
33
34
ASSERT
(
s
[
12
] ==
'X'
);
35
#endif
36
}
37
38
void
39
testTortureExecute
(
void
)
40
{
41
f
();
42
return
;
43
}
44