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
56ee7837
Commit
56ee7837
authored
Mar 25, 1998
by
Benjamin Kosnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
�
test cases for g++15235 From-SVN: r18830
parent
dba21b32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
gcc/testsuite/g++.old-deja/g++.benjamin/bool02.C
+63
-0
No files found.
gcc/testsuite/g++.old-deja/g++.benjamin/bool02.C
0 → 100644
View file @
56ee7837
//980324 bkoz
//test for bool and bitwise ands
#include <assert.h>
void
bar
(
bool
x
)
{};
void
bars
(
short
x
)
{};
#if 0
int andb(){
bool y;
bar ( y );
int blob = ( 27 & int (y) );
return blob; //expect 1 or 0
}
#endif
int
andbtrue
(){
bool
y
=
true
;
bar
(
y
);
int
blob
=
(
27
&
int
(
y
)
);
return
blob
;
//expect 1
}
int
andbfalse
(){
bool
y
=
false
;
bar
(
y
);
int
blob
=
(
27
&
int
(
y
)
);
return
blob
;
//expect 0
}
int
andbfalse2
(){
bool
y
=
0
;
bar
(
y
);
int
blob
=
(
27
&
int
(
y
)
);
return
blob
;
//expect 0
}
int
ands
(){
short
y
=
1
;
bars
(
y
);
int
blob
=
(
27
&
int
(
y
)
);
return
blob
;
//expect 1
}
int
main
()
{
int
tmp
;
#if 0
tmp = andb();
assert (tmp == 1 || tmp == 0);
#endif
tmp
=
andbtrue
();
assert
(
tmp
==
1
);
tmp
=
andbfalse
();
assert
(
tmp
==
0
);
tmp
=
andbfalse2
();
assert
(
tmp
==
0
);
tmp
=
ands
();
assert
(
tmp
==
1
);
return
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