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
54303b5c
Commit
54303b5c
authored
Jul 07, 1998
by
Richard Henderson
Committed by
Richard Henderson
Jul 07, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.c-torture/execute/bcp-1.c: New test.
From-SVN: r20998
parent
41b083c4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.c-torture/execute/bcp-1.c
+78
-0
No files found.
gcc/testsuite/ChangeLog
View file @
54303b5c
Tue Jul 7 13:41:27 1998 Richard Henderson <rth@cygnus.com>
* gcc.c-torture/execute/bcp-1.c: New test.
Tue Jul 7 11:49:04 1998 Jeffrey A Law (law@cygnus.com)
* gcc.c-torture/execute/980707-1.c: New test.
...
...
gcc/testsuite/gcc.c-torture/execute/bcp-1.c
0 → 100644
View file @
54303b5c
int
global
;
/* These must fail. */
int
bad0
(
void
)
{
return
__builtin_constant_p
(
global
);
}
int
bad1
(
void
)
{
return
__builtin_constant_p
(
global
++
);
}
inline
int
bad2
(
int
x
)
{
return
__builtin_constant_p
(
x
++
);
}
inline
int
bad3
(
int
x
)
{
return
__builtin_constant_p
(
x
);
}
inline
int
bad4
(
const
char
*
x
)
{
return
__builtin_constant_p
(
x
);
}
int
bad5
(
void
)
{
return
bad2
(
1
);
}
inline
int
bad6
(
int
x
)
{
return
__builtin_constant_p
(
x
+
1
);
}
int
bad7
(
void
)
{
return
__builtin_constant_p
(
abort
());
}
int
bad8
(
void
)
{
char
buf
[
10
];
return
__builtin_constant_p
(
buf
);
}
int
bad9
(
const
char
*
x
)
{
return
__builtin_constant_p
(
x
[
123456
]);
}
/* These must pass, or we've broken gcc2 functionality. */
int
good0
(
void
)
{
return
__builtin_constant_p
(
1
);
}
int
good1
(
void
)
{
return
__builtin_constant_p
(
"hi"
);
}
int
good2
(
void
)
{
return
__builtin_constant_p
((
1234
+
45
)
&
~
7
);
}
/* These are extensions to gcc2. Failure indicates an optimization
regression. */
int
opt0
(
void
)
{
return
bad3
(
1
);
}
int
opt1
(
void
)
{
return
bad4
(
"hi"
);
}
int
opt2
(
void
)
{
return
bad6
(
1
);
}
int
opt3
(
void
)
{
return
__builtin_constant_p
(
&
global
);
}
int
opt4
(
void
)
{
return
__builtin_constant_p
(
"hi"
[
0
]);
}
/* Call through tables so -finline-functions can't screw with us. */
int
(
*
bad_t0
[])(
void
)
=
{
bad0
,
bad1
,
bad5
,
bad7
,
bad8
};
int
(
*
bad_t1
[])(
int
x
)
=
{
bad2
,
bad3
,
bad6
};
int
(
*
bad_t2
[])(
const
char
*
x
)
=
{
bad4
,
bad9
};
int
(
*
good_t0
[])(
void
)
=
{
good0
,
good1
,
good2
};
int
(
*
opt_t0
[])(
void
)
=
{
opt0
,
opt1
,
opt2
,
opt3
,
opt4
};
#define N(arr) (sizeof(arr)/sizeof(*arr))
int
main
()
{
int
i
;
for
(
i
=
0
;
i
<
N
(
bad_t0
);
++
i
)
if
((
*
bad_t0
[
i
])())
abort
();
for
(
i
=
0
;
i
<
N
(
bad_t1
);
++
i
)
if
((
*
bad_t1
[
i
])(
1
))
abort
();
for
(
i
=
0
;
i
<
N
(
bad_t2
);
++
i
)
if
((
*
bad_t2
[
i
])(
"hi"
))
abort
();
for
(
i
=
0
;
i
<
N
(
good_t0
);
++
i
)
if
(
!
(
*
good_t0
[
i
])())
abort
();
#ifdef __OPTIMIZE__
for
(
i
=
0
;
i
<
N
(
good_t0
);
++
i
)
if
(
!
(
*
opt_t0
[
i
])())
abort
();
#endif
exit
(
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