aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/cast-weirds.c
blob: 136137b4c86ea390c407b30c687ae69d650e12e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
typedef unsigned int uint;
typedef unsigned long ulong;

static int * int_2_iptr(int a) { return (int *)a; }
static int * uint_2_iptr(uint a) { return (int *)a; }

static void * int_2_vptr(int a) { return (void *)a; }
static void * uint_2_vptr(uint a) { return (void *)a; }

/*
 * check-name: cast-weirds
 * check-command: test-linearize -m64 $file
 *
 * check-error-start
cast-weirds.c:4:42: warning: non size-preserving integer to pointer cast
cast-weirds.c:5:44: warning: non size-preserving integer to pointer cast
 * check-error-end
 *
 * check-output-start
int_2_iptr:
.L0:
	<entry-point>
	utptr.64    %r2 <- (32) %arg1
	ret.64      %r2


uint_2_iptr:
.L2:
	<entry-point>
	utptr.64    %r5 <- (32) %arg1
	ret.64      %r5


int_2_vptr:
.L4:
	<entry-point>
	scast.64    %r8 <- (32) %arg1
	ret.64      %r8


uint_2_vptr:
.L6:
	<entry-point>
	cast.64     %r11 <- (32) %arg1
	ret.64      %r11


 * check-output-end
 */