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
59b30ca6
Commit
59b30ca6
authored
May 05, 2000
by
Neil Booth
Committed by
Neil Booth
May 05, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r33697
parent
5f97a7dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
0 deletions
+102
-0
gcc/testsuite/ChangeLog
+5
-0
gcc/testsuite/gcc.dg/cpp-opprec.c
+97
-0
No files found.
gcc/testsuite/ChangeLog
View file @
59b30ca6
2000-05-04 Neil Booth <NeilB@earthling.net>
* gcc.dg/cpp-opprec.c: New tests for operator precedence in the
preprocessor.
2000-05-04 Richard Henderson <rth@cygnus.com>
2000-05-04 Richard Henderson <rth@cygnus.com>
* gcc.c-torture/execute/20000503-1.c: Fix typo.
* gcc.c-torture/execute/20000503-1.c: Fix typo.
...
...
gcc/testsuite/gcc.dg/cpp-opprec.c
0 → 100644
View file @
59b30ca6
/* Copyright (C) 2000 Free Software Foundation, Inc. */
/* Test the full range of preprocessor operator precedence. Each
operator is tested with one of immediately higher precedence to
verify it is of strictly lower precedence. To avoid complications,
each test uses just those two operators. Occasionally this assumes
correct operation of if-then-else, so the first tests verify this. */
/* { dg-do preprocess } */
/* Ensure correct functioning of if-then-else. */
#if 1
#else
#error #else block evaluated for true conditional
#endif
#if 0
#error #if block evaluated for false conditional
#else
#endif
/* , not higher than ?. This is not a syntax error if it is. */
#if 1 ? 0, 1: 1
/* { dg-error "syntax" "? higher precedence than ," } */
#error
#endif
/* : strictly higher than ?. This would give a syntax error otherwise. */
#if 0 ? 0 : 1 ? 1 : 1
#endif
/* || strictly higher than ?:. */
#if 1 ? 0: 0 || 1
#error operator ?: has higher precedence than operator ||
#endif
/* && strictly higher than ||. */
#if 1 || 0 && 0
#else
#error operator || has higher precedence than operator &&
#endif
/* | strictly higher than &&. */
#if 0 && 0 | 1
#error operator && has higher precedence than operator |
#endif
/* ^ strictly higher than |. */
#if 1 | 0 ^ 1
#else
#error operator | has higher precedence than operator ^
#endif
/* & strictly higher than ^. */
#if 1 ^ 0 & 0
#else
#error operator ^ has higher precedence than operator &
#endif
/* == (!=) strictly higher than &. */
#if 0 & 0 == 0
#error operator & has higher precedence than operator ==
#endif
/* < (>, <=, >=) strictly higher than == (!=). */
#if 0 == 0 < 0
#else
#error operator == has higher precedence than operator <
#endif
/* << (>>) strictly higher than < (>, <=, >=). */
#if 1 < 1 << 1
#else
#error operator < has higher precedence than operator <<
#endif
/* Binary + (-) strictly higher than << (>>). */
#if 0 << 0 + 1
#error operator << has higher precedence than binary +
#endif
/* Binary * (/, %) strictly higher than binary + (-). */
#if 1 + 0 * 0
#else
#error binary + has higher precedence than binary *
#endif
/* Unary operators (!, ~, -, +) strictly higher than binary * (/, %).
Equality is hard to detect because of right-associativity. */
#if ~1 * 0
#error binary * has higher precedence than operator ~
#endif
/* () > Unary. Unfortunately this requires an additional operator. */
#if -(1 - 1)
#error unary - has higher precedence than operator ()
#endif
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