aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/eval/asm-memop.c
blob: 33ba0e5a588a2460f2d790eb8d3c9a989540c0c4 (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
extern int g;

void fo0(int *p) { asm volatile ("op %0" :: "p" (&g)); }
void fo1(int *p) { asm volatile ("op %0" :: "m" (g)); }

void fo2(int *p) { asm volatile ("op %0" :: "p" (p)); }
void fo3(int *p) { asm volatile ("op %0" :: "m" (*p)); }

/*
 * check-name: eval-asm-memop
 * check-command: test-linearize -Wno-decl $file
 *
 * check-output-start
fo0:
.L0:
	<entry-point>
	asm         "op %0"
		in: "p" (g)
	ret


fo1:
.L2:
	<entry-point>
	asm         "op %0"
		in: "m" (g)
	ret


fo2:
.L4:
	<entry-point>
	asm         "op %0"
		in: "p" (%arg1)
	ret


fo3:
.L6:
	<entry-point>
	asm         "op %0"
		in: "m" (%arg1)
	ret


 * check-output-end
 */