Revert "clang support gnu asm goto."

This reverts commit 954ec09aed4f2be04bb5f4e10dbb4ea8bd19ef9a.

Reverting due to test failures as requested by Jennifer Yu.

Conflicts:
	clang/test/CodeGen/asm-goto.c

llvm-svn: 362106
diff --git a/clang/test/Analysis/asm-goto.cpp b/clang/test/Analysis/asm-goto.cpp
deleted file mode 100644
index 3d4babc..0000000
--- a/clang/test/Analysis/asm-goto.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
-
-int foo(int cond)
-{
-label_true:
-  asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
-  return 0;
-loop:
-  return 0;
-}
-
-// CHECK-LABEL: loop
-// CHECK-NEXT: 0
-// CHECK-NEXT: return
-// CHECK-NEXT: Preds (1): B3
-// CHECK-NEXT: Succs (1): B0
-
-// CHECK-LABEL: label_true
-// CHECK-NEXT: asm goto
-// CHECK-NEXT: Preds (2): B3 B4
-// CHECK-NEXT: Succs (3): B2 B3 B1
-
-
-int bar(int cond)
-{
-  asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::L1, L2);
-  return 0;
-L1:
-L2:
-  return 0;
-}
-
-// CHECK: [B4]
-// CHECK-NEXT: asm goto
-// CHECK-NEXT: Preds (1): B5
-// CHECK-NEXT: Succs (3): B3 B2 B1
-
-int zoo(int n)
-{
-A5:
-A1:
-  asm goto("testl %0, %0; jne %l1;" :: "r"(n)::A1, A2, A3, A4, A5);
-A2:
-A3:
-A4:
-  return 0;
-}
-
-// CHECK-LABEL: A1
-// CHECK-NEXT: asm goto
-// CHECK-NEXT: Preds (2): B5 B4
-// CHECK-NEXT: Succs (5): B3 B4 B2 B1 B5
diff --git a/clang/test/CodeGen/asm-goto.c b/clang/test/CodeGen/asm-goto.c
deleted file mode 100644
index 99e97f2..0000000
--- a/clang/test/CodeGen/asm-goto.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 -triple x86_64 -O0 -emit-llvm %s -o - | FileCheck %s
-
-int foo(int cond)
-{
-  // CHECK: callbr void asm sideeffect
-  // CHECK: to label %asm.fallthrough [label %label_true, label %loop], !srcloc !2
-  // CHECK: asm.fallthrough:
-  asm volatile goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
-  asm volatile goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
-  // CHECK: callbr void asm sideeffect
-  // CHECK: to label %asm.fallthrough1 [label %label_true, label %loop], !srcloc !3
-  // CHECK: asm.fallthrough1:
-  return 0;
-loop:
-  return 0;
-label_true:
-  return 1;
-}
diff --git a/clang/test/CodeGen/asm.c b/clang/test/CodeGen/asm.c
index 7de7963..038d346 100644
--- a/clang/test/CodeGen/asm.c
+++ b/clang/test/CodeGen/asm.c
@@ -262,15 +262,3 @@
   // CHECK: @t31
   // CHECK: call void asm sideeffect "", "=*%rm,=*rm,0,1,~{dirflag},~{fpsr},~{flags}"
 }
-
-// CHECK: @t32
-int t32(int cond)
-{
-  asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
-  // CHECK: callbr void asm sideeffect "testl $0, $0; jne ${1:l};", "r,X,X,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* blockaddress(@t32, %label_true), i8* blockaddress(@t32, %loop)) #1
-  return 0;
-loop:
-  return 0;
-label_true:
-  return 1;
-}
diff --git a/clang/test/CodeGen/inline-asm-mixed-style.c b/clang/test/CodeGen/inline-asm-mixed-style.c
index a9e111c..6b830d9 100644
--- a/clang/test/CodeGen/inline-asm-mixed-style.c
+++ b/clang/test/CodeGen/inline-asm-mixed-style.c
@@ -1,3 +1,4 @@
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fasm-blocks -fsyntax-only -verify %s -DCHECK_ASM_GOTO
 // RUN: %clang_cc1 -triple i386-unknown-unknown -fasm-blocks -O0 -emit-llvm -S %s -o - | FileCheck %s
 // REQUIRES: x86-registered-target
 
@@ -19,11 +20,10 @@
   // CHECK: movl    %ebx, %eax
   // CHECK: movl    %ecx, %edx
 
-  __asm volatile goto ("movl %ecx, %edx");
-  // CHECK: movl    %ecx, %edx
+#ifdef CHECK_ASM_GOTO
+  __asm volatile goto ("movl %ecx, %edx"); // expected-error {{'asm goto' constructs are not supported yet}}
 
   __asm mov eax, ebx
-  __asm goto ("movl %ecx, %edx");
-  // CHECK: movl    %ebx, %eax
-  // CHECK: movl    %ecx, %edx
+  __asm goto ("movl %ecx, %edx"); // expected-error {{'asm goto' constructs are not supported yet}}
+#endif
 }
diff --git a/clang/test/Coverage/c-language-features.inc b/clang/test/Coverage/c-language-features.inc
index ea3b96f..3566879 100644
--- a/clang/test/Coverage/c-language-features.inc
+++ b/clang/test/Coverage/c-language-features.inc
@@ -71,9 +71,7 @@
   }
 
   asm ("nop");
-  int cond;
-  asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true);
-label_true:
+
   return;
 }
 
diff --git a/clang/test/PCH/asm.h b/clang/test/PCH/asm.h
index 5a7268e..a568058 100644
--- a/clang/test/PCH/asm.h
+++ b/clang/test/PCH/asm.h
@@ -1,14 +1,10 @@
 // Header for the PCH test asm.c
 
 void f() {
-  int i,cond;
+  int i;
 
   asm ("foo\n" : : "a" (i + 2));
   asm ("foo\n" : [symbolic_name] "=a" (i) : "[symbolic_name]" (i));
-  asm volatile goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
-label_true:
-loop:
-  return;
 }
 
 void clobbers() {
diff --git a/clang/test/Parser/asm.c b/clang/test/Parser/asm.c
index 489b545..637f9d7 100644
--- a/clang/test/Parser/asm.c
+++ b/clang/test/Parser/asm.c
@@ -21,56 +21,6 @@
 }
 
 
-int a, b, c, d, e, f, g, h, i, j, k, l;
-
-void
-fgoto1 (void)
-{
-  __asm__ volatile goto (""
-            :: [a] "r" (a), [b] "r" (b), [c] "r" (c), [d] "r" (d),
-               [e] "r" (e), [f] "r" (f), [g] "r" (g), [h] "r" (h),
-               [i] "r" (i), [j] "r" (j), [k] "r" (k), [l] "r" (l)
-            ::lab1,lab2);
-lab1: return;
-lab2: return;
-}
-
-void
-fgoto2 (void)
-{
-  __asm__ volatile goto (""
-            :: [a] "r,m" (a), [b] "r,m" (b), [c] "r,m" (c), [d] "r,m" (d),
-               [e] "r,m" (e), [f] "r,m" (f), [g] "r,m" (g), [h] "r,m" (h),
-               [i] "r,m" (i), [j] "r,m" (j), [k] "r,m" (k), [l] "r,m" (l)
-            :: lab);
-  lab: return;
-}
-
-int zoo ()
-{
-  int x,cond,*e;
-  // expected-error@+1 {{expected ')'}}
-  asm ("mov %[e], %[e]" : : [e] "rm" (*e)::a)
-  // expected-error@+1 {{'asm goto' cannot have output constraints}}
-  asm goto ("decl %0; jnz %l[a]" :"=r"(x): "m"(x) : "memory" : a);
-  // expected-error@+1 {{expected identifie}}
-  asm goto ("decl %0;" :: "m"(x) : "memory" : );
-  // expected-error@+1 {{expected ':'}}
-  asm goto ("decl %0;" :: "m"(x) : "memory" );
-  // expected-error@+1 {{use of undeclared label 'x'}}
-  asm goto ("decl %0;" :: "m"(x) : "memory" :x);
-  // expected-error@+1 {{use of undeclared label 'b'}}
-  asm goto ("decl %0;" :: "m"(x) : "memory" :b);
-  // expected-error@+1 {{invalid operand number in inline asm string}}
-  asm goto ("testl %0, %0; jne %l3;" :: "r"(cond)::label_true, loop);
-  // expected-error@+1 {{unknown symbolic operand name in inline assembly string}}
-  asm goto ("decl %0; jnz %l[b]" :: "m"(x) : "memory" : a);
-a:
-label_true:
-loop:
-  return 0;
-}
-
 // rdar://5952468
 __asm ; // expected-error {{expected '(' after 'asm'}}
 
diff --git a/clang/test/Parser/asm.cpp b/clang/test/Parser/asm.cpp
index 9c4d62a..9f64dfe 100644
--- a/clang/test/Parser/asm.cpp
+++ b/clang/test/Parser/asm.cpp
@@ -7,54 +7,3 @@
 int foo5 asm (U"bar5"); // expected-error {{cannot use unicode string literal in 'asm'}}
 int foo6 asm ("bar6"_x); // expected-error {{string literal with user-defined suffix cannot be used here}}
 int foo6 asm ("" L"bar7"); // expected-error {{cannot use wide string literal in 'asm'}}
-
-int zoo ()
-{
-  int x,cond,*e;
-  // expected-error@+1 {{expected ')'}}
-  asm ("mov %[e], %[e]" : : [e] "rm" (*e)::a)
-  // expected-error@+1  {{'asm goto' cannot have output constraints}}
-  asm goto ("decl %0; jnz %l[a]" :"=r"(x): "m"(x) : "memory" : a);
-  // expected-error@+1 {{expected identifie}}
-  asm goto ("decl %0;" :: "m"(x) : "memory" : );
-  // expected-error@+1  {{expected ':'}}
-  asm goto ("decl %0;" :: "m"(x) : "memory" );
-  // expected-error@+1 {{use of undeclared label 'x'}}
-  asm goto ("decl %0;" :: "m"(x) : "memory" :x);
-  // expected-error@+1 {{use of undeclared label 'b'}}
-  asm goto ("decl %0;" :: "m"(x) : "memory" :b);
-  // expected-error@+1 {{invalid operand number in inline asm string}}
-  asm goto ("testl %0, %0; jne %l3;" :: "r"(cond)::label_true, loop);
-  // expected-error@+1 {{unknown symbolic operand name in inline assembly string}}
-  asm goto ("decl %0; jnz %l[b]" :: "m"(x) : "memory" : a);
-label_true:
-loop:
-a:
-  return 0;
-}
-
-
-int a, b, c, d, e, f, g, h, i, j, k, l;
-
-void
-fgoto1 (void)
-{
-  __asm__ volatile goto (""
-            :: [a] "r" (a), [b] "r" (b), [c] "r" (c), [d] "r" (d),
-               [e] "r" (e), [f] "r" (f), [g] "r" (g), [h] "r" (h),
-               [i] "r" (i), [j] "r" (j), [k] "r" (k), [l] "r" (l)
-            ::lab1,lab2);
-lab1: return;
-lab2: return;
-}
-
-void
-fgoto2 (void)
-{
-  __asm__ volatile goto (""
-            :: [a] "r,m" (a), [b] "r,m" (b), [c] "r,m" (c), [d] "r,m" (d),
-               [e] "r,m" (e), [f] "r,m" (f), [g] "r,m" (g), [h] "r,m" (h),
-               [i] "r,m" (i), [j] "r,m" (j), [k] "r,m" (k), [l] "r,m" (l)
-            :: lab);
-  lab: return;
-}
diff --git a/clang/test/Sema/asm-goto.cpp b/clang/test/Sema/asm-goto.cpp
deleted file mode 100644
index f61a809..0000000
--- a/clang/test/Sema/asm-goto.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-// RUN: %clang_cc1 %s -triple i386-pc-linux-gnu -verify -fsyntax-only
-
-struct NonTrivial {
-  ~NonTrivial();
-  int f(int);
-private:
-  int k;
-};
-void JumpDiagnostics(int n) {
-// expected-error@+1 {{cannot jump from this goto statement to its label}}
-  goto DirectJump;
-// expected-note@+1 {{jump bypasses variable with a non-trivial destructor}}
-  NonTrivial tnp1;
-
-DirectJump:
-// expected-error@+1 {{cannot jump from this asm goto statement to one of its possible targets}}
-  asm goto("jmp %l0;" ::::Later);
-// expected-note@+1 {{jump bypasses variable with a non-trivial destructor}}
-  NonTrivial tnp2;
-// expected-note@+1 {{possible target of asm goto statement}}
-Later:
-  return;
-}
-
-struct S { ~S(); };
-void foo(int a) {
-  if (a) {
-FOO:
-// expected-note@+2 {{jump exits scope of variable with non-trivial destructor}}
-// expected-note@+1 {{jump exits scope of variable with non-trivial destructor}}
-    S s;
-    void *p = &&BAR;
-// expected-error@+1 {{cannot jump from this asm goto statement to one of its possible targets}}
-  asm goto("jmp %l0;" ::::BAR);
-// expected-error@+1 {{cannot jump from this indirect goto statement to one of its possible targets}}
-    goto *p;
-    p = &&FOO;
-    goto *p;
-    return;
-  }
-// expected-note@+2 {{possible target of asm goto statement}}
-// expected-note@+1 {{possible target of indirect goto statement}}
-BAR:
-  return;
-}
diff --git a/clang/test/Sema/asm.c b/clang/test/Sema/asm.c
index 29a55c6..67da197 100644
--- a/clang/test/Sema/asm.c
+++ b/clang/test/Sema/asm.c
@@ -295,24 +295,3 @@
   return r0 + r1;
 }
 
-void test18()
-{
-  // expected-error@+2 {{duplicate use of asm operand name "lab"}}
-  // expected-note@+1 {{asm operand name "lab" first referenced here}}
-  asm goto ("" : : : : lab, lab, lab2, lab);
-  // expected-error@+2 {{duplicate use of asm operand name "lab"}}
-  // expected-note@+1 {{asm operand name "lab" first referenced here}}
-  asm goto ("xorw %[lab], %[lab]; je %l[lab]" : : [lab] "i" (0) : : lab);
-lab:;
-lab2:;
-  int x,x1;
-  // expected-error@+2 {{duplicate use of asm operand name "lab"}}
-  // expected-note@+1 {{asm operand name "lab" first referenced here}}
-  asm ("" : [lab] "=r" (x),[lab] "+r" (x) : [lab1] "r" (x));
-  // expected-error@+2 {{duplicate use of asm operand name "lab"}}
-  // expected-note@+1 {{asm operand name "lab" first referenced here}}
-  asm ("" : [lab] "=r" (x1) : [lab] "r" (x));
-  // expected-error@+1 {{invalid operand number in inline asm string}}
-  asm ("jne %l0":::);
-  asm goto ("jne %l0"::::lab);
-}
diff --git a/clang/test/Sema/inline-asm-validate-tmpl.cpp b/clang/test/Sema/inline-asm-validate-tmpl.cpp
index 9e234ca..cf7eac3 100644
--- a/clang/test/Sema/inline-asm-validate-tmpl.cpp
+++ b/clang/test/Sema/inline-asm-validate-tmpl.cpp
@@ -23,13 +23,3 @@
 	asm("rol %1, %0" :"=r"(value): "I"(N + 1));
 }
 int	foo() { testc<2>(10); }
-
-// these should compile without error
-template <int N> bool testd()
-{
-  __asm goto ("" : : : : lab);
-  return true;
-lab:
-  return false;
-}
-bool foox() { return testd<0> (); }
diff --git a/clang/test/Sema/scope-check.c b/clang/test/Sema/scope-check.c
index 0622450..fa37d10 100644
--- a/clang/test/Sema/scope-check.c
+++ b/clang/test/Sema/scope-check.c
@@ -232,19 +232,3 @@
 
 // rdar://9024687
 int test16(int [sizeof &&z]); // expected-error {{use of address-of-label extension outside of a function body}}
-
-//Asm goto:
-int test16(int n)
-{
-  // expected-error@+2 {{cannot jump from this asm goto statement to one of its possible targets}}
-  // expected-error@+1 {{cannot jump from this asm goto statement to one of its possible targets}}
-  asm volatile goto("testl %0, %0; jne %l1;" :: "r"(n)::label_true, loop);
-  // expected-note@+2 {{jump bypasses initialization of variable length array}}
-  // expected-note@+1 {{possible target of asm goto statement}}
-  return ({int a[n];label_true: 2;});
-  // expected-note@+1 {{jump bypasses initialization of variable length array}}
-  int b[n];
-// expected-note@+1 {{possible target of asm goto statement}}
-loop:
-  return 0;
-}