Polly 20.0.0git
bug-swap.c
Go to the documentation of this file.
1/* Regression test for mp_int_swap() bug on self-stored values. */
2#include <stdio.h>
3#include "imath.h"
4
5int main(int argc, char* argv[]) {
6 mpz_t a, b;
7 int result;
8
10 mp_int_init_value(&b, 16);
11
12 mp_int_swap(&a, &b);
13 result = (a.digits == &(a.single) && b.digits == &(b.single) &&
14 a.digits[0] == 16 && b.digits[0] == 1);
15
16 printf("REGRESSION: mp_int_swap() on self-stored values: %s\n",
17 result ? "OK" : "FAILED");
18
21 return !result;
22}
polly print import Polly Print Scop import result
a(0)
b(9)
#define mp_int_clear
Definition: wrap.h:72
#define mp_int_swap
Definition: wrap.h:119
#define mp_int_init_value
Definition: wrap.h:98