[llvm] e7f1331 - [FunctionAttrs] Add test for argmemonly function that already has attr (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 29 04:56:42 PDT 2022


Author: Nikita Popov
Date: 2022-09-29T13:56:31+02:00
New Revision: e7f133191008b137aa9ef611b676ce2ec3c116a7

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

LOG: [FunctionAttrs] Add test for argmemonly function that already has attr (NFC)

Test for the issue reported in https://reviews.llvm.org/D134527#3821010.

Added: 
    

Modified: 
    llvm/test/Transforms/FunctionAttrs/argmemonly.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/FunctionAttrs/argmemonly.ll b/llvm/test/Transforms/FunctionAttrs/argmemonly.ll
index 204c609f5a77d..1954f7023b94c 100644
--- a/llvm/test/Transforms/FunctionAttrs/argmemonly.ll
+++ b/llvm/test/Transforms/FunctionAttrs/argmemonly.ll
@@ -25,6 +25,18 @@ entry:
   ret i32 %l
 }
 
+define i32 @test_only_read_arg_already_has_argmemonly(i32* %ptr) argmemonly {
+; CHECK: Function Attrs: argmemonly mustprogress nofree norecurse nosync nounwind readonly willreturn
+; CHECK-LABEL: @test_only_read_arg_already_has_argmemonly(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[L:%.*]] = load i32, i32* [[PTR:%.*]], align 4
+; CHECK-NEXT:    ret i32 [[L]]
+;
+entry:
+  %l = load i32, i32* %ptr
+  ret i32 %l
+}
+
 define i32 @test_read_global() {
 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readonly willreturn
 ; CHECK-LABEL: @test_read_global(


        


More information about the llvm-commits mailing list