diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2018-02-26 16:37:11 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2018-02-26 16:37:11 +0000 |
commit | e6799923e4b05846a0cfc76008117779b320b2d7 (patch) | |
tree | 333a2bbcef71cfabb56a26077fd90530ac133f1c | |
parent | 70a1af611a9ff257d2d9596f3f21129c835e2414 (diff) | |
download | gcc-e6799923e4b05846a0cfc76008117779b320b2d7.zip gcc-e6799923e4b05846a0cfc76008117779b320b2d7.tar.gz gcc-e6799923e4b05846a0cfc76008117779b320b2d7.tar.bz2 |
Re-add test.
From-SVN: r257998
-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 0000000..e2b678c --- /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; +} |