Print this page
11972 resync smatch
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/src/validation/int128.c
+++ new/usr/src/tools/smatch/src/validation/int128.c
1 1 typedef __int128 int128_t;
2 2 typedef signed __int128 sint128_t;
3 3 typedef unsigned __int128 uint128_t;
4 4
5 5 typedef __int128 int badxi;
6 6 typedef int __int128 badix;
7 7 typedef unsigned unsigned __int128 baduu;
8 8 typedef double __int128 baddx;
9 9 typedef __int128 double badxd;
10 10
11 11 int sizeof_int128(void)
12 12 {
13 13 return sizeof(__int128);
14 14 }
15 15
16 16 typedef unsigned long long u64;
17 17 typedef unsigned long u32;
18 18
19 19 u64 foo(u64 a, u64 b, u64 c, u32 s)
20 20 {
21 21 unsigned __int128 tmp;
22 22
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
23 23 tmp = (((uint128_t)a) * b) + c;
24 24 return (u64) (tmp >> s);
25 25 }
26 26
27 27 /*
28 28 * check-name: int128
29 29 * check-command: test-linearize $file
30 30 * check-output-ignore
31 31 *
32 32 * check-output-contains: ret\\..*\\$16
33 - * check-output-contains: mulu\\.128
33 + * check-output-contains: mul\\.128
34 34 * check-output-contains: add\\.128
35 35 *
36 36 * check-error-start
37 37 int128.c:5:18: error: two or more data types in declaration specifiers
38 38 int128.c:5:18: error: Trying to use reserved word 'int' as identifier
39 39 int128.c:5:25: error: Expected ; at end of declaration
40 40 int128.c:5:25: error: got badxi
41 41 int128.c:6:13: error: two or more data types in declaration specifiers
42 42 int128.c:6:13: error: Trying to use reserved word '__int128' as identifier
43 43 int128.c:6:25: error: Expected ; at end of declaration
44 44 int128.c:6:25: error: got badix
45 45 int128.c:7:18: error: impossible combination of type specifiers: unsigned unsigned
46 46 int128.c:7:18: error: Trying to use reserved word 'unsigned' as identifier
47 47 int128.c:7:27: error: Expected ; at end of declaration
48 48 int128.c:7:27: error: got __int128
49 49 int128.c:8:16: error: two or more data types in declaration specifiers
50 50 int128.c:8:16: error: Trying to use reserved word '__int128' as identifier
51 51 int128.c:8:25: error: Expected ; at end of declaration
52 52 int128.c:8:25: error: got baddx
53 53 int128.c:9:18: error: two or more data types in declaration specifiers
54 54 int128.c:9:18: error: Trying to use reserved word 'double' as identifier
55 55 int128.c:9:25: error: Expected ; at end of declaration
56 56 int128.c:9:25: error: got badxd
57 57 * check-error-end
58 58 */
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX