1 //===-- negvdi2_test.c - Test __negvdi2 -----------------------------------===//
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 __negvdi2 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
19 // Effects: aborts if -a overflows
21 di_int
__negvdi2(di_int a
);
23 int test__negvdi2(di_int a
)
25 di_int x
= __negvdi2(a
);
28 printf("error in __negvdi2(0x%llX) = %lld, expected %lld\n",
35 // if (test__negvdi2(0x8000000000000000LL)) // should abort
37 if (test__negvdi2(0x0000000000000000LL
))
39 if (test__negvdi2(0x0000000000000001LL
))
41 if (test__negvdi2(0x0000000000000002LL
))
43 if (test__negvdi2(0x7FFFFFFFFFFFFFFELL
))
45 if (test__negvdi2(0x7FFFFFFFFFFFFFFFLL
))
47 if (test__negvdi2(0x8000000000000001LL
))
49 if (test__negvdi2(0x8000000000000002LL
))
51 if (test__negvdi2(0xFFFFFFFFFFFFFFFELL
))
53 if (test__negvdi2(0xFFFFFFFFFFFFFFFFLL
))