blob: c9c1d7f77fbb4aa1d107a604ffa0a72facfdf08e (
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
|
/* PR c/41045 */
/* { dg-do compile } */
/* { dg-options "-O0" } */
/* { dg-additional-options "-fno-pie" { target pie } } */
extern int v[42];
asm ("# %0" : "=:" (32)); /* { dg-error "lvalue required in 'asm' statement" } */
/* { dg-error "':' constraint used for output operand" "" { target *-*-* } .-1 } */
asm ("# %0" : "=:" (v)); /* { dg-error "':' constraint used for output operand" } */
asm ("# %0" : : "i:" (v)); /* { dg-error "':' constraint mixed with other constraints" } */
asm ("# %0" : : ":i" (v)); /* { dg-error "':' constraint mixed with other constraints" } */
asm ("# %0" : : ",:" (v)); /* { dg-error "':' constraint mixed with other constraints" } */
asm ("# %0" : : ":,:" (v));
asm ("# %0" : : ":," (v)); /* { dg-error "':' constraint mixed with other constraints" } */
asm ("# %0" : : ":,,:" (v)); /* { dg-error "':' constraint mixed with other constraints" } */
asm ("" : : ":" (0)); /* { dg-error "constraint operand is not address of a function or non-automatic variable" } */
void
foo (int x)
{
int y;
l:;
asm ("" : : ":" (&x)); /* { dg-error "constraint operand is not address of a function or non-automatic variable" } */
asm ("" : : ":" (&&l)); /* { dg-error "constraint operand is not address of a function or non-automatic variable" } */
asm ("" : : ":" (&y)); /* { dg-error "constraint operand is not address of a function or non-automatic variable" } */
asm ("" : : ":" (0)); /* { dg-error "constraint operand is not address of a function or non-automatic variable" } */
}
|