1 //===-- negvsi2_test.c - Test __negvsi2 -----------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file tests __negvsi2 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
19 // Effects: aborts if -a overflows
21 si_int
__negvsi2(si_int a
);
23 int test__negvsi2(si_int a
)
25 si_int x
= __negvsi2(a
);
28 printf("error in __negvsi2(0x%X) = %d, expected %d\n", a
, x
, expected
);
34 // if (test__negvsi2(0x80000000)) // should abort
36 if (test__negvsi2(0x00000000))
38 if (test__negvsi2(0x00000001))
40 if (test__negvsi2(0x00000002))
42 if (test__negvsi2(0x7FFFFFFE))
44 if (test__negvsi2(0x7FFFFFFF))
46 if (test__negvsi2(0x80000001))
48 if (test__negvsi2(0x80000002))
50 if (test__negvsi2(0xFFFFFFFE))
52 if (test__negvsi2(0xFFFFFFFF))