[llvm] d944b1e - [InstCombine][NFC] Use --check-globals flag in tests.

Dávid Bolvanský via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 06:06:56 PDT 2021


Author: Dawid Jurczak
Date: 2021-04-22T15:06:42+02:00
New Revision: d944b1e0f2db0aa4d29ded58bcacd53210662b91

URL: https://github.com/llvm/llvm-project/commit/d944b1e0f2db0aa4d29ded58bcacd53210662b91
DIFF: https://github.com/llvm/llvm-project/commit/d944b1e0f2db0aa4d29ded58bcacd53210662b91.diff

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

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

Split off from D100724.

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D101034

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/printf-2.ll b/llvm/test/Transforms/InstCombine/printf-2.ll
index 66678bc557cc7..16caf3420f981 100644
--- a/llvm/test/Transforms/InstCombine/printf-2.ll
+++ b/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 @@ declare void @printf(i8*, ...)
 
 ; 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 @@ define void @test_simplify7() {
   call void (i8*, ...) @printf(i8* %fmt, i8* %str)
   ret void
 }
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nofree nounwind }
+;.


        


More information about the llvm-commits mailing list