[PATCH] D16561: Tweak unnamed label syntax in textual IR for easier matching in tests.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 15:41:21 PST 2016


eugenis created this revision.
eugenis added subscribers: llvm-commits, pcc.
eugenis set the repository for this revision to rL LLVM.

Change the unnamed label comments like
  ; <label>:8  ; preds = %1
to
  ; <label>:8:  ; preds = %1

This way lit tests can match [[LABEL]]: in both asserts and no-asserts builds.


Repository:
  rL LLVM

http://reviews.llvm.org/D16561

Files:
  lib/IR/AsmWriter.cpp
  test/Transforms/SimplifyCFG/merge-cond-stores-2.ll

Index: test/Transforms/SimplifyCFG/merge-cond-stores-2.ll
===================================================================
--- test/Transforms/SimplifyCFG/merge-cond-stores-2.ll
+++ test/Transforms/SimplifyCFG/merge-cond-stores-2.ll
@@ -27,10 +27,10 @@
 ; CHECK: select
 ; CHECK-NOT: select
 ; CHECK: br i1 {{.*}}, label %[[L:.*]], label %[[R:.*]]
-; CHECK: [[L]] ; preds = 
+; CHECK: [[L]]: ; preds =
 ; CHECK-NEXT: store
 ; CHECK-NEXT: br label %[[R]]
-; CHECK: [[R]] ; preds = 
+; CHECK: [[R]]: ; preds =
 ; CHECK-NEXT: ret i32 0
 
 define i32 @f(i32* %b) {
Index: lib/IR/AsmWriter.cpp
===================================================================
--- lib/IR/AsmWriter.cpp
+++ lib/IR/AsmWriter.cpp
@@ -2676,7 +2676,7 @@
     Out << "\n; <label>:";
     int Slot = Machine.getLocalSlot(BB);
     if (Slot != -1)
-      Out << Slot;
+      Out << Slot << ":";
     else
       Out << "<badref>";
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16561.45923.patch
Type: text/x-patch
Size: 911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160125/fd0a9e08/attachment.bin>


More information about the llvm-commits mailing list