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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
comptime {
asm volatile ("");
}
comptime {
asm (""
: [_] "" (-> u8),
);
}
comptime {
asm (""
:
: [_] "" (0),
);
}
comptime {
asm ("" ::: .{});
}
export fn a() void {
asm ("");
}
export fn b() void {
asm (""
: [_] "" (-> u8),
[_] "" (-> u8),
);
}
export fn c() void {
var out: u8 = 0;
asm (""
: [_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
[_] "" (out),
);
}
export fn d() void {
asm volatile (""
:
: [_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
[_] "" (0),
);
}
// error
//
// :2:9: error: volatile is meaningless on global assembly
// :5:5: error: global assembly cannot have inputs, outputs, or clobbers
// :10:5: error: global assembly cannot have inputs, outputs, or clobbers
// :16:5: error: global assembly cannot have inputs, outputs, or clobbers
// :19:5: error: assembly expression with no output must be marked volatile
// :24:12: error: inline assembly allows up to one output value
// :46:12: error: too many asm outputs
// :84:12: error: too many asm inputs
|