[PATCH] D101034: [InstCombine][NFC] Use --check-globals flag in tests.

Dawid Jurczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 02:08:21 PDT 2021


yurai007 created this revision.
yurai007 added reviewers: xbolva00, spatel, fhahn, lebedev.ri.
yurai007 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch adds strings content checking to printf-2.ll via --check-globals flag.

      

Split off from D100724 <https://reviews.llvm.org/D100724>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101034

Files:
  llvm/test/Transforms/InstCombine/printf-2.ll


Index: llvm/test/Transforms/InstCombine/printf-2.ll
===================================================================
--- llvm/test/Transforms/InstCombine/printf-2.ll
+++ llvm/test/Transforms/InstCombine/printf-2.ll
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
 ; Test that the printf library call simplifier works correctly.
 ;
 ; RUN: opt < %s -instcombine -S | FileCheck %s
@@ -15,6 +15,14 @@
 
 ; Check simplification of printf with void return type.
 
+;.
+; CHECK: @[[HELLO_WORLD:[a-zA-Z0-9_$"\\.-]+]] = constant [13 x i8] c"hello world\0A\00"
+; CHECK: @[[H:[a-zA-Z0-9_$"\\.-]+]] = constant [2 x i8] c"h\00"
+; CHECK: @[[PERCENT_S:[a-zA-Z0-9_$"\\.-]+]] = constant [4 x i8] c"%s\0A\00"
+; CHECK: @[[FORMAT_STR:[a-zA-Z0-9_$"\\.-]+]] = constant [3 x i8] c"%s\00"
+; CHECK: @[[CHARSTR:[a-zA-Z0-9_$"\\.-]+]] = constant [2 x i8] c"a\00"
+; CHECK: @[[STR:[a-zA-Z0-9_$"\\.-]+]] = private unnamed_addr constant [12 x i8] c"hello world\00", align 1
+;.
 define void @test_simplify1() {
 ; CHECK-LABEL: @test_simplify1(
 ; CHECK-NEXT:    [[PUTCHAR:%.*]] = call i32 @putchar(i32 104)
@@ -56,3 +64,6 @@
   call void (i8*, ...) @printf(i8* %fmt, i8* %str)
   ret void
 }
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nofree nounwind }
+;.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101034.339525.patch
Type: text/x-patch
Size: 1382 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210422/c225dab1/attachment.bin>


More information about the llvm-commits mailing list