1 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -fsyntax-only -verify -std=c++11 %s
2 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify -std=c++11 %s
4 int a
, b
, c
, d
, e
, f
, g
, h
, i
, j
, k
, l
;
7 __asm__
volatile goto (""
8 :: [a
] "r" (a
), [b
] "r" (b
), [c
] "r" (c
), [d
] "r" (d
),
9 [e
] "r" (e
), [f
] "r" (f
), [g
] "r" (g
), [h
] "r" (h
),
10 [i
] "r" (i
), [j
] "r" (j
), [k
] "r" (k
), [l
] "r" (l
)
17 __asm__
volatile goto (""
18 :: [a
] "r,m" (a
), [b
] "r,m" (b
), [c
] "r,m" (c
), [d
] "r,m" (d
),
19 [e
] "r,m" (e
), [f
] "r,m" (f
), [g
] "r,m" (g
), [h
] "r,m" (h
),
20 [i
] "r,m" (i
), [j
] "r,m" (j
), [k
] "r,m" (k
), [l
] "r,m" (l
)
26 __asm__
volatile goto ("decl %0; jnz %l[a]"
27 : "=r" (x
) : "m" (x
) : "memory" : a
);
35 __asm__
volatile goto ("decl %0; jnz %l[a]"
36 : "=r" (x
), "=r" (y
) : "m" (x
) : "memory" : a
);
38 __asm__
volatile goto ("decl %0; jnz %l[b]"
39 : "=r" (x
), "=r" (y
) : "m" (x
) : "memory" : b
);
49 // expected-error@+1 {{expected ')'}}
50 asm ("mov %[e], %[e]" : : [e
] "rm" (*e
)::a
)
51 // expected-error@+1 {{expected identifier}}
52 asm goto ("decl %0;" :: "m"(x
) : "memory" : );
53 // expected-error@+1 {{expected ':'}}
54 asm goto ("decl %0;" :: "m"(x
) : "memory" );
55 // expected-error@+1 {{use of undeclared label 'x'}}
56 asm goto ("decl %0;" :: "m"(x
) : "memory" :x
);
57 // expected-error@+1 {{use of undeclared label 'b'}}
58 asm goto ("decl %0;" :: "m"(x
) : "memory" :b
);
59 // expected-error@+1 {{invalid operand number in inline asm string}}
60 asm goto ("testl %0, %0; jne %l3;" :: "r"(cond
)::label_true
, loop
);
61 // expected-error@+1 {{unknown symbolic operand name in inline assembly string}}
62 asm goto ("decl %0; jnz %l[b]" :: "m"(x
) : "memory" : a
);
71 // expected-error@+1 {{expected ')'}}
72 asm ("mov %[e], %[e]" : "=r" (y
) : [e
] "rm" (*e
), "r" (y
) :: a
)
73 // expected-error@+1 {{expected identifier}}
74 asm goto ("decl %0;" : "=r" (y
) : "m" (x
), "r" (y
) : "memory" :);
75 // expected-error@+1 {{expected ':'}}
76 asm goto ("decl %0;" : "=r" (y
) : "m" (x
), "r" (y
) : "memory");
77 // expected-error@+1 {{use of undeclared label 'x'}}
78 asm goto ("decl %0;" : "=r" (y
) : "m" (x
), "r" (y
) : "memory" : x
);
79 // expected-error@+1 {{use of undeclared label 'b'}}
80 asm goto ("decl %0;" : "=r" (y
) : "m" (x
), "r" (y
) : "memory" : b
);
81 // expected-error@+1 {{invalid operand number in inline asm string}}
82 asm goto ("testl %0, %0; jne %l5;" : "=r" (y
) : "r" (cond
), "r" (y
) :: label_true
, loop
);
83 // expected-error@+1 {{unknown symbolic operand name in inline assembly string}}
84 asm goto ("decl %0; jnz %l[b]" : "=r" (y
) : "m" (x
), "r" (y
) : "memory" : a
);