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
994de9dd
Commit
994de9dd
authored
Feb 28, 1999
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New test cases.
From-SVN: r25498
parent
282e5df8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
0 deletions
+125
-0
gcc/testsuite/g++.old-deja/g++.martin/sts_conv.C
+24
-0
gcc/testsuite/g++.old-deja/g++.martin/sts_iarr.C
+45
-0
gcc/testsuite/g++.old-deja/g++.martin/sts_partial.C
+15
-0
gcc/testsuite/g++.old-deja/g++.martin/sts_vectini.C
+41
-0
No files found.
gcc/testsuite/g++.old-deja/g++.martin/sts_conv.C
0 → 100644
View file @
994de9dd
// ecgs-bugs 1999-02-22 14:21, Stefan Schwarzer
// sts@ica1.uni-stuttgart.de
// this code should compile quietly
class
CArray
{
public
:
operator
double
*
(){
return
a
;
}
// works if we comment this line:
operator
double
*
()
const
{
return
const_cast
<
double
*>
(
a
);
}
private
:
double
a
[
2
];
};
int
main
(){
CArray
a
;
double
*
pa
=
a
+
1
;
// gets bogus error - should convert
return
0
;
}
gcc/testsuite/g++.old-deja/g++.martin/sts_iarr.C
0 → 100644
View file @
994de9dd
// egcs-bugs 999-02-22 14:26 Stefan Schwarzer
// sts@ica1.uni-stuttgart.de
// should compile and return 0
template
<
int
N
>
struct
Outer
{
struct
Inner
{
Inner
(
int
n
)
:
sum
(
n
){}
typename
Outer
<
N
-
1
>::
Inner
operator
[](
int
n
)
const
{
return
Outer
<
N
-
1
>::
Inner
(
sum
+
n
);
}
int
sum
;
};
typename
Outer
<
N
-
1
>::
Inner
operator
[](
int
n
)
const
{
return
Outer
<
N
-
1
>::
Inner
(
n
);
}
};
// specializations for N==1
template
<>
struct
Outer
<
1
>
{
struct
Inner
{
Inner
(
int
n
)
:
sum
(
n
){}
int
operator
[](
int
n
)
const
{
return
sum
+
n
;
}
int
sum
;
};
int
operator
[](
int
n
)
const
{
return
n
;
}
};
int
main
()
{
Outer
<
1
>
sum1
;
//std::cout << sum1[1] << "\n";
Outer
<
2
>
sum2
;
//std::cout << sum2[1][1] << "\n";
return
sum1
[
1
]
+
sum2
[
1
][
1
]
-
3
;
}
gcc/testsuite/g++.old-deja/g++.martin/sts_partial.C
0 → 100644
View file @
994de9dd
// excess errors test - XFAIL
// ecgs-bugs 1999-02-22 14:26 Stefan Schwarzer
// sts@ica1.uni-stuttgart.de
// partial ordering problem in egcs <= 1.1.1
template
<
class
T
>
int
f
(
T
&
){
return
1
;
}
template
<
class
T
>
int
f
(
T
[]
){
return
0
;
}
int
main
(){
int
d
[]
=
{
2
};
return
f
(
d
);
}
gcc/testsuite/g++.old-deja/g++.martin/sts_vectini.C
0 → 100644
View file @
994de9dd
// Special g++ Options: -O2
// egcs-bugs 1999-02-22 14:24 Stefan Schwarzer
// sts@ica1.uni-stuttgart.de
// optimizer problem in egcs <= 1.1.1
struct
XTVec
{
XTVec
(){
x
[
0
]
=
x
[
1
]
=
x
[
2
]
=
0
;}
XTVec
(
int
ax
,
int
y
=
0
.,
int
z
=
0
.){
x
[
0
]
=
ax
;
x
[
1
]
=
y
;
x
[
2
]
=
z
;
}
int
&
operator
[](
int
);
int
x
[
3
];
};
inline
int
&
XTVec
::
operator
[](
int
i
){
return
x
[
i
];
}
inline
XTVec
&
operator
+=
(
XTVec
&
lhs
,
XTVec
&
rhs
){
lhs
[
0
]
+=
rhs
[
0
];
lhs
[
1
]
+=
rhs
[
1
];
lhs
[
2
]
+=
rhs
[
2
];
return
lhs
;
}
inline
XTVec
operator
+
(
XTVec
&
lhs
,
XTVec
&
rhs
){
XTVec
result
(
lhs
);
return
result
+=
rhs
;
}
int
main
()
{
XTVec
ur
(
4
.,
0
.,
1
.);
XTVec
ll
(
0
.,
2
.,
0
.);
XTVec
initsum
(
ur
+
ll
);
// sum of components should be 7
return
(
initsum
[
0
]
+
initsum
[
1
]
+
initsum
[
2
]
-
7
);
}
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