Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
f4f2b07a
Commit
f4f2b07a
authored
Apr 08, 2003
by
Richard Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New test.
From-SVN: r65378
parent
3fdaa45a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
gcc/testsuite/gcc.c-torture/execute/20030408-1.c
+69
-0
No files found.
gcc/testsuite/gcc.c-torture/execute/20030408-1.c
0 → 100644
View file @
f4f2b07a
/* PR optimization/8634 */
/* Contributed by Glen Nakamura <glen at imodulo dot com> */
extern
void
abort
(
void
);
struct
foo
{
char
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
;
};
int
test1
()
{
const
char
X
[
8
]
=
{
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
};
char
buffer
[
8
];
__builtin_memcpy
(
buffer
,
X
,
8
);
if
(
buffer
[
0
]
!=
'A'
||
buffer
[
1
]
!=
'B'
||
buffer
[
2
]
!=
'C'
||
buffer
[
3
]
!=
'D'
||
buffer
[
4
]
!=
'E'
||
buffer
[
5
]
!=
'F'
||
buffer
[
6
]
!=
'G'
||
buffer
[
7
]
!=
'H'
)
abort
();
return
0
;
}
int
test2
()
{
const
char
X
[
10
]
=
{
'A'
,
'B'
,
'C'
,
'D'
,
'E'
};
char
buffer
[
10
];
__builtin_memcpy
(
buffer
,
X
,
10
);
if
(
buffer
[
0
]
!=
'A'
||
buffer
[
1
]
!=
'B'
||
buffer
[
2
]
!=
'C'
||
buffer
[
3
]
!=
'D'
||
buffer
[
4
]
!=
'E'
||
buffer
[
5
]
!=
'\0'
||
buffer
[
6
]
!=
'\0'
||
buffer
[
7
]
!=
'\0'
||
buffer
[
8
]
!=
'\0'
||
buffer
[
9
]
!=
'\0'
)
abort
();
return
0
;
}
int
test3
()
{
const
struct
foo
X
=
{
a
:
'A'
,
c
:
'C'
,
e
:
'E'
,
g
:
'G'
,
i
:
'I'
};
char
buffer
[
10
];
__builtin_memcpy
(
buffer
,
&
X
,
10
);
if
(
buffer
[
0
]
!=
'A'
||
buffer
[
1
]
!=
'\0'
||
buffer
[
2
]
!=
'C'
||
buffer
[
3
]
!=
'\0'
||
buffer
[
4
]
!=
'E'
||
buffer
[
5
]
!=
'\0'
||
buffer
[
6
]
!=
'G'
||
buffer
[
7
]
!=
'\0'
||
buffer
[
8
]
!=
'I'
||
buffer
[
9
]
!=
'\0'
)
abort
();
return
0
;
}
int
test4
()
{
const
struct
foo
X
=
{
.
b
=
'B'
,
.
d
=
'D'
,
.
f
=
'F'
,
.
h
=
'H'
,
.
j
=
'J'
};
char
buffer
[
10
];
__builtin_memcpy
(
buffer
,
&
X
,
10
);
if
(
buffer
[
0
]
!=
'\0'
||
buffer
[
1
]
!=
'B'
||
buffer
[
2
]
!=
'\0'
||
buffer
[
3
]
!=
'D'
||
buffer
[
4
]
!=
'\0'
||
buffer
[
5
]
!=
'F'
||
buffer
[
6
]
!=
'\0'
||
buffer
[
7
]
!=
'H'
||
buffer
[
8
]
!=
'\0'
||
buffer
[
9
]
!=
'J'
)
abort
();
return
0
;
}
int
main
()
{
test1
();
test2
();
test3
();
test4
();
return
0
;
}
Write
Preview
Markdown
is supported
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