[PATCH] D118262: [NFC] compatibility: add test for allocsize attribute

Augie Fackler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 09:14:15 PST 2022


durin42 created this revision.
durin42 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Depends on D117922 <https://reviews.llvm.org/D117922>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118262

Files:
  llvm/test/Bitcode/compatibility.ll


Index: llvm/test/Bitcode/compatibility.ll
===================================================================
--- llvm/test/Bitcode/compatibility.ll
+++ llvm/test/Bitcode/compatibility.ll
@@ -1510,7 +1510,7 @@
   ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
 
   call void @f.nobuiltin() builtin
-  ; CHECK: call void @f.nobuiltin() #46
+  ; CHECK: call void @f.nobuiltin() #48
 
   call fastcc noalias i32* @f.noalias() noinline
   ; CHECK: call fastcc noalias i32* @f.noalias() #12
@@ -1923,6 +1923,13 @@
 ; CHECK: declare void @byval_type2({ i8, i8* }* byval({ i8, i8* }))
 ; CHECK: declare void @byval_named_type([8 x i8]* byval([8 x i8]))
 
+declare void @f.allocsize_one(i32) allocsize(0)
+declare void @f.allocsize_two(i32, i32) allocsize(1, 0)
+; CHECK: Function Attrs: allocsize(0)
+; CHECK: declare void @f.allocsize_one(i32)
+; CHECK: Function Attrs: allocsize(1,0)
+; CHECK: declare void @f.allocsize_two(i32, i32)
+
 ; CHECK: attributes #0 = { alignstack=4 }
 ; CHECK: attributes #1 = { alignstack=8 }
 ; CHECK: attributes #2 = { alwaysinline }
@@ -1969,7 +1976,9 @@
 ; CHECK: attributes #43 = { strictfp }
 ; CHECK: attributes #44 = { nosanitize_coverage }
 ; CHECK: attributes #45 = { disable_sanitizer_instrumentation }
-; CHECK: attributes #46 = { builtin }
+; CHECK: attributes #46 = { allocsize(0) }
+; CHECK: attributes #47 = { allocsize(1,0) }
+; CHECK: attributes #48 = { builtin }
 
 ;; Metadata
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118262.403305.patch
Type: text/x-patch
Size: 1467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220126/1896f2e3/attachment.bin>


More information about the llvm-commits mailing list