[PATCH] D88195: Remove stale assert.

Bill Wendling via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 12:59:15 PDT 2020


void updated this revision to Diff 294141.
void added a comment.

Fix test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88195/new/

https://reviews.llvm.org/D88195

Files:
  clang/lib/AST/Stmt.cpp
  clang/test/Modules/Inputs/asm-goto/a.h
  clang/test/Modules/Inputs/asm-goto/module.modulemap
  clang/test/Modules/asm-goto.c


Index: clang/test/Modules/asm-goto.c
===================================================================
--- /dev/null
+++ clang/test/Modules/asm-goto.c
@@ -0,0 +1,12 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fno-implicit-modules -x c -I%S/Inputs/asm-goto -emit-module %S/Inputs/asm-goto/module.modulemap -fmodule-name=a -o %t/a.pcm
+// RUN: %clang_cc1 -fmodules -fno-implicit-modules -x c -I%S/Inputs/asm-goto -emit-llvm -o - %s -fmodule-file=%t/a.pcm | FileCheck %s
+#include "a.h"
+
+// CHECK-LABEL: define i32 @foo(
+// CHECK: callbr {{.*}} "=r,X,{{.*}}"(i8* blockaddress(@foo, %indirect))
+// CHECK-NEXT: to label %asm.fallthrough [label %indirect]
+
+int bar(void) {
+  return foo();
+}
Index: clang/test/Modules/Inputs/asm-goto/module.modulemap
===================================================================
--- /dev/null
+++ clang/test/Modules/Inputs/asm-goto/module.modulemap
@@ -0,0 +1 @@
+module a { header "a.h" export * }
Index: clang/test/Modules/Inputs/asm-goto/a.h
===================================================================
--- /dev/null
+++ clang/test/Modules/Inputs/asm-goto/a.h
@@ -0,0 +1,13 @@
+int foo(void) {
+  int x;
+
+  asm goto(""
+           : "=r"(x)
+           :
+           :
+           : indirect);
+  x = 42;
+
+indirect:
+  return x;
+}
Index: clang/lib/AST/Stmt.cpp
===================================================================
--- clang/lib/AST/Stmt.cpp
+++ clang/lib/AST/Stmt.cpp
@@ -528,7 +528,6 @@
   this->NumInputs = NumInputs;
   this->NumClobbers = NumClobbers;
   this->NumLabels = NumLabels;
-  assert(!(NumOutputs && NumLabels) && "asm goto cannot have outputs");
 
   unsigned NumExprs = NumOutputs + NumInputs + NumLabels;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88195.294141.patch
Type: text/x-patch
Size: 1706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200924/f9e6fac4/attachment.bin>


More information about the cfe-commits mailing list