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 3 4 int zoo () 5 { 6 int x,cond,*e; 7 // expected-error@+1 {{expected ')'}} 8 asm ("mov %[e], %[e]" : : [e] "rm" (*e)::a) 9 // expected-error@+1 {{'asm goto' cannot have output constraints}} 10 asm goto ("decl %0; jnz %l[a]" :"=r"(x): "m"(x) : "memory" : a); 11 // expected-error@+1 {{expected identifie}} 12 asm goto ("decl %0;" :: "m"(x) : "memory" : ); 13 // expected-error@+1 {{expected ':'}} 14 asm goto ("decl %0;" :: "m"(x) : "memory" ); 15 // expected-error@+1 {{use of undeclared label 'x'}} 16 asm goto ("decl %0;" :: "m"(x) : "memory" :x); 17 // expected-error@+1 {{use of undeclared label 'b'}} 18 asm goto ("decl %0;" :: "m"(x) : "memory" :b); 19 // expected-error@+1 {{invalid operand number in inline asm string}} 20 asm goto ("testl %0, %0; jne %l3;" :: "r"(cond)::label_true, loop); 21 // expected-error@+1 {{unknown symbolic operand name in inline assembly string}} 22 asm goto ("decl %0; jnz %l[b]" :: "m"(x) : "memory" : a); 23 label_true: 24 loop: 25 a: 26 return 0; 27 } 28 29 30 int a, b, c, d, e, f, g, h, i, j, k, l; 31 32 void 33 fgoto1 (void) 34 { 35 __asm__ volatile goto ("" 36 :: [a] "r" (a), [b] "r" (b), [c] "r" (c), [d] "r" (d), 37 [e] "r" (e), [f] "r" (f), [g] "r" (g), [h] "r" (h), 38 [i] "r" (i), [j] "r" (j), [k] "r" (k), [l] "r" (l) 39 ::lab1,lab2); 40 lab1: return; 41 lab2: return; 42 } 43 44 void 45 fgoto2 (void) 46 { 47 __asm__ volatile goto ("" 48 :: [a] "r,m" (a), [b] "r,m" (b), [c] "r,m" (c), [d] "r,m" (d), 49 [e] "r,m" (e), [f] "r,m" (f), [g] "r,m" (g), [h] "r,m" (h), 50 [i] "r,m" (i), [j] "r,m" (j), [k] "r,m" (k), [l] "r,m" (l) 51 :: lab); 52 lab: return; 53 } 54