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
29aad310
Commit
29aad310
authored
Jan 20, 2001
by
Neil Booth
Committed by
Neil Booth
Jan 20, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.dg/cpp/macro3.c,macro4.c,strp1.c: Update.
From-SVN: r39153
parent
673b13e2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
35 deletions
+18
-35
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.dg/cpp/macro3.c
+7
-17
gcc/testsuite/gcc.dg/cpp/macro4.c
+6
-17
gcc/testsuite/gcc.dg/cpp/strp1.c
+1
-1
No files found.
gcc/testsuite/ChangeLog
View file @
29aad310
2001-01-20 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/cpp/macro3.c,macro4.c,strp1.c: Update.
2001-01-19 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/20010119-1.c: New test.
...
...
gcc/testsuite/gcc.dg/cpp/macro3.c
View file @
29aad310
...
...
@@ -5,23 +5,17 @@
Varargs test source Jamie Lokier.
All adapted for the testsuite by Neil Booth, Oct 2000. */
int
c
(
int
x
)
{
return
x
;
}
int
a
(
int
x
)
{
return
x
;
}
/* Tests various macro abuse is correctly expanded. */
static
int
d
=
4
;
#define c(x) d
#define d(x) c(2)
/* Every GCC <= 2.96 appears to fail this. */
#if 0
/* This macro chain above sucks up the whole file once it starts, so
I've commented it out. The example is left for idle amusement :-) */
#define a(x) b(
#define b(x) a(
#endif
#define apply(...) apply2 (__VA_ARGS__)
#define half(x) ((x) / 2)
...
...
@@ -32,12 +26,8 @@ extern void exit (int);
int
main
()
{
/* Expands to c(2). */
if
(
c
(
c
)(
c
)
!=
2
)
abort
();
/* Expands to a(2). */
if
(
a
(
a
)
x
)
2
)
!=
2
)
/* Expands to c(2) then d. */
if
(
c
(
c
)(
c
)
!=
4
)
abort
();
if
(
apply
(
half
,
200
)
!=
100
)
...
...
gcc/testsuite/gcc.dg/cpp/macro4.c
View file @
29aad310
/* Copyright (C) 2000 Free Software Foundation, Inc. */
/* { dg-do
run
} */
/* { dg-do
preprocess
} */
/* Test source Neil Booth. GCC <= 2.96 don't get this right. */
extern
void
abort
(
void
);
int
glue
(
int
x
,
int
y
)
{
return
x
+
y
;
}
/* Test source Neil Booth. */
#define glue(x, y) x ## y
#define xglue(x, y) glue (x, y)
int
main
()
{
/* Should expand to glue (1, 2) as the second "glue" is nested. */
if
(
glue
(
xgl
,
ue
)
(
1
,
2
)
!=
3
)
abort
();
return
0
;
}
/* Should expand to glue (1, 2), then 12. */
#if glue (xgl, ue) (1, 2) != 12
#error glue macro
#endif
gcc/testsuite/gcc.dg/cpp/strp1.c
View file @
29aad310
...
...
@@ -16,7 +16,7 @@ static const char t1[] = "1.1";
#define f h
#define h(a) a+f
static
const
char
s2
[]
=
S
(
f
(
1
)(
2
)
);
static
const
char
t2
[]
=
"1+
f
(2)"
;
static
const
char
t2
[]
=
"1+
h
(2)"
;
#undef I
#undef f
...
...
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