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
c1a7b241
Commit
c1a7b241
authored
Nov 14, 2001
by
Roger Sayle
Committed by
Richard Henderson
Nov 14, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.c-torture/execute/string-opt-13.c: New testcase.
From-SVN: r47030
parent
d59b3b67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.c-torture/execute/string-opt-13.c
+58
-0
No files found.
gcc/testsuite/ChangeLog
View file @
c1a7b241
2001-11-14 Roger Sayle <roger@eyesopen.com>
* gcc.c-torture/execute/string-opt-13.c: New testcase.
2001-11-14 Richard Sandiford <rsandifo@redhat.com>
* g++.dg/init/array2.C: New test.
...
...
gcc/testsuite/gcc.c-torture/execute/string-opt-13.c
0 → 100644
View file @
c1a7b241
/* Copyright (C) 2001 Free Software Foundation.
Ensure all builtin strlen comparisons against zero are optimized
and perform correctly. The multiple calls to strcpy are to prevent
the potentially "pure" strlen calls from being removed by CSE.
Written by Roger Sayle, 11/02/2001. */
extern
void
abort
(
void
);
typedef
__SIZE_TYPE__
size_t
;
extern
size_t
strlen
(
const
char
*
);
extern
char
*
strcpy
(
char
*
,
const
char
*
);
int
main
()
{
char
str
[
8
];
char
*
ptr
;
ptr
=
str
;
strcpy
(
ptr
,
"nts"
);
if
(
strlen
(
ptr
)
==
0
)
abort
();
strcpy
(
ptr
,
"nts"
);
if
(
strlen
(
ptr
)
<
1
)
abort
();
strcpy
(
ptr
,
"nts"
);
if
(
strlen
(
ptr
)
<=
0
)
abort
();
strcpy
(
ptr
,
"nts"
);
if
(
strlen
(
ptr
+
3
)
!=
0
)
abort
();
strcpy
(
ptr
,
"nts"
);
if
(
strlen
(
ptr
+
3
)
>
0
)
abort
();
strcpy
(
ptr
,
"nts"
);
if
(
strlen
(
str
+
3
)
>=
1
)
abort
();
return
0
;
}
#ifdef __OPTIMIZE__
/* When optimizing, all the above cases should be transformed into
something else. So any remaining calls to the original function
should abort. */
static
size_t
strlen
(
const
char
*
s
)
{
abort
();
}
#endif
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