diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-26 16:37:11 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-26 16:37:11 +0000 |
commit | 29e9e9f1b7cba6472ce146ed2023d1ee8115b26d (patch) | |
tree | 333a2bbcef71cfabb56a26077fd90530ac133f1c | |
parent | d5934e6339fbb67247f3bf9d3e78a20156008f29 (diff) | |
download | gcc-29e9e9f1b7cba6472ce146ed2023d1ee8115b26d.tar.gz |
Re-add test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257998 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20180226-1.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20180226-1.c b/gcc/testsuite/gcc.c-torture/execute/20180226-1.c new file mode 100644 index 00000000000..e2b678c8fc7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20180226-1.c @@ -0,0 +1,31 @@ +/* PR rtl-optimization/83496 */ +/* Reported by Hauke Mehrtens <gcc@hauke-m.de> */ + +extern void abort (void); + +typedef unsigned long mp_digit; + +typedef struct { int used, alloc, sign; mp_digit *dp; } mp_int; + +int mytest(mp_int *a, mp_digit b) __attribute__((noclone, noinline)); + +int mytest(mp_int *a, mp_digit b) +{ + if (a->sign == 1) + return -1; + if (a->used > 1) + return 1; + if (a->dp[0] > b) + return 1; + if (a->dp[0] < b) + return -1; + return 0; +} + +int main (void) +{ + mp_int i = { 2, 0, -1 }; + if (mytest (&i, 0) != 1) + abort (); + return 0; +} |