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
ef72b1d3
Commit
ef72b1d3
authored
May 27, 2002
by
Kaveh R. Ghazi
Committed by
Kaveh Ghazi
May 27, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.c-torture/execute/pure-1.c: New test.
From-SVN: r53937
parent
630363b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
0 deletions
+94
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.c-torture/execute/pure-1.c
+90
-0
No files found.
gcc/testsuite/ChangeLog
View file @
ef72b1d3
2002-05-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.c-torture/execute/pure-1.c: New test.
2002-05-27 Neil Booth <neil@daikokuya.demon.co.uk>
2002-05-27 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/cpp/arith-2.c: Remove.
* gcc.dg/cpp/arith-2.c: Remove.
...
...
gcc/testsuite/gcc.c-torture/execute/pure-1.c
0 → 100644
View file @
ef72b1d3
/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> 2002-05-27. */
/* Use a different function for each test so the link failures
indicate which one is broken. */
extern
void
link_error0
(
void
);
extern
void
link_error1
(
void
);
extern
void
link_error2
(
void
);
extern
void
link_error3
(
void
);
extern
void
link_error4
(
void
);
extern
void
link_error5
(
void
);
extern
void
link_error6
(
void
);
extern
void
link_error7
(
void
);
extern
int
i
;
extern
int
func0
(
int
)
__attribute__
((
__pure__
));
extern
int
func1
(
int
)
__attribute__
((
__const__
));
/* GCC should automatically detect attributes for these functions.
Don't allow -O3 to inline them. */
#define ANI __attribute__ ((__noinline__))
static
int
ANI
func2
(
int
a
)
{
return
i
+
a
;
}
/* pure */
static
int
ANI
func3
(
int
a
)
{
return
a
*
3
;
}
/* const */
static
int
ANI
func4
(
int
a
)
{
return
func0
(
a
)
+
a
;
}
/* pure */
static
int
ANI
func5
(
int
a
)
{
return
a
+
func1
(
a
);
}
/* const */
static
int
ANI
func6
(
int
a
)
{
return
func2
(
a
)
+
a
;
}
/* pure */
static
int
ANI
func7
(
int
a
)
{
return
a
+
func3
(
a
);
}
/* const */
int
main
()
{
int
i
[
10
],
r
;
i
[
0
]
=
0
;
r
=
func0
(
0
);
if
(
i
[
0
])
link_error0
();
i
[
1
]
=
0
;
r
=
func1
(
0
);
if
(
i
[
1
])
link_error1
();
i
[
2
]
=
0
;
r
=
func2
(
0
);
if
(
i
[
2
])
link_error2
();
i
[
3
]
=
0
;
r
=
func3
(
0
);
if
(
i
[
3
])
link_error3
();
i
[
4
]
=
0
;
r
=
func4
(
0
);
if
(
i
[
4
])
link_error4
();
i
[
5
]
=
0
;
r
=
func5
(
0
);
if
(
i
[
5
])
link_error5
();
i
[
6
]
=
0
;
r
=
func6
(
0
);
if
(
i
[
6
])
link_error6
();
i
[
7
]
=
0
;
r
=
func7
(
0
);
if
(
i
[
7
])
link_error7
();
return
r
;
}
int
func0
(
int
a
)
{
return
a
-
i
;
}
/* pure */
int
func1
(
int
a
)
{
return
a
-
a
;
}
/* const */
int
i
=
2
;
#ifndef __OPTIMIZE__
/* Avoid link failures when not optimizing. */
void
link_error0
()
{}
void
link_error1
()
{}
void
link_error2
()
{}
void
link_error3
()
{}
void
link_error4
()
{}
void
link_error5
()
{}
void
link_error6
()
{}
void
link_error7
()
{}
#endif
/* ! __OPTIMIZE__ */
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