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
d2ae3ff5
Commit
d2ae3ff5
authored
26 years ago
by
Zack Weinberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New testcase for cpp, written by Kaveh Ghazi <ghazi@caip.rutgers.edu>
From-SVN: r25398
parent
c7b2eb81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
gcc/testsuite/gcc.dg/cpp-if3.c
+23
-0
No files found.
gcc/testsuite/gcc.dg/cpp-if3.c
0 → 100644
View file @
d2ae3ff5
/* { dg-do preprocess } */
/* { dg-options -pedantic-errors } */
#define U_MAX 4294967295U
#define ULL_MAX 18446744073709551615ULL
#define LL_MAX 9223372036854775807LL
#define LL_MIN (-LL_MAX-1)
/* Check simple truncation. */
#if U_MAX == ULL_MAX || LL_MIN == 0 || LL_MAX == -1
#error "simple truncation"
/* { dg-bogus "trunc" "simple truncation" } */
#endif
/* Check left/right shifting with all bits set and with one bit set. */
#if !(~0ULL >> 63) || !(~0ULL << 63) || !(~0LL >> 63) || !(~0LL << 63) || \
!(LL_MIN >> 63) || !(1LL << 63) || !(ULL_MAX >> 63) || !(1ULL << 63)
#error "bit shift truncation"
/* { dg-bogus "trunc" "bit shift truncation" } */
#endif
/* Check math expressions. */
#if (2ULL * U_MAX < U_MAX) || (1ULL + U_MAX < U_MAX)
#error "math truncation"
/* { dg-bogus "trunc" "math truncation" } */
#endif
This diff is collapsed.
Click to expand it.
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