diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-04 22:24:12 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-04 22:24:12 +0000 |
commit | d5d15736f782b75dd463fed4279ecfbfe62ce9ea (patch) | |
tree | 554d4fcbbefd729d8d802a888bfc3a6e99fe9406 /gcc/testsuite | |
parent | b6009807db690b551409b23d43adb3ae4195d6ed (diff) | |
download | gcc-d5d15736f782b75dd463fed4279ecfbfe62ce9ea.tar.gz |
PR c/7102
* optabs.c (expand_binop): Convert CONST_INTs in all cases.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56815 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20020904-1.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020904-1.c b/gcc/testsuite/gcc.c-torture/execute/20020904-1.c new file mode 100644 index 00000000000..24eeb0cb0a0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20020904-1.c @@ -0,0 +1,19 @@ +/* PR c/7102 */ + +/* Verify that GCC zero-extends integer constants + in unsigned binary operations. */ + +typedef unsigned char u8; + +u8 fun(u8 y) +{ + u8 x=((u8)255)/y; + return x; +} + +int main(void) +{ + if (fun((u8)2) != 127) + abort (); + return 0; +} |