From 7ab6c76ad1cbf36284ca5b6bd5ee33c625fe3e60 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 20 Feb 2013 07:21:42 +0000 Subject: Modify the LLVM assembly output so that it uses references to represent function attributes. This makes the LLVM assembly look better. E.g.: define void @foo() #0 { ret void } attributes #0 = { nounwind noinline ssp } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175605 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll | 4 +++- test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll | 6 +++++- test/Transforms/DeadArgElim/keepalive.ll | 7 ++++--- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'test/Transforms/DeadArgElim') diff --git a/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll b/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll index 20b5da529d..72a269b976 100644 --- a/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll +++ b/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll @@ -4,7 +4,7 @@ @g = global i8 0 -; CHECK: define internal void @foo(i8 signext %y) nounwind +; CHECK: define internal void @foo(i8 signext %y) #0 define internal zeroext i8 @foo(i8* inreg %p, i8 signext %y, ... ) nounwind { store i8 %y, i8* @g @@ -16,3 +16,5 @@ define i32 @bar() { %A = call zeroext i8(i8*, i8, ...)* @foo(i8* inreg null, i8 signext 1, %struct* byval null ) nounwind ret i32 0 } + +; CHECK: attributes #0 = { nounwind } diff --git a/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll b/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll index 2f820bad84..fc63da1235 100644 --- a/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll +++ b/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll @@ -15,7 +15,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone -define internal fastcc i8* @add_name_internal(i8* %name, i32 %len, i32 %hash, i8 zeroext %extra, i32 %flags) nounwind noinline ssp { +define internal fastcc i8* @add_name_internal(i8* %name, i32 %len, i32 %hash, i8 zeroext %extra, i32 %flags) noinline nounwind ssp { entry: call void @llvm.dbg.value(metadata !{i8* %name}, i64 0, metadata !15) call void @llvm.dbg.value(metadata !{i32 %len}, i64 0, metadata !20) @@ -38,6 +38,10 @@ bb2: ; preds = %bb1, %bb declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone +; CHECK: attributes #0 = { nounwind ssp } +; CHECK: attributes #1 = { nounwind readnone } +; CHECK: attributes #2 = { noinline nounwind ssp } + !0 = metadata !{i32 524545, metadata !1, metadata !"name", metadata !2, i32 8, metadata !6} ; [ DW_TAG_arg_variable ] !1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"vfs_addname", metadata !"vfs_addname", metadata !"vfs_addname", metadata !2, i32 12, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false} ; [ DW_TAG_subprogram ] !2 = metadata !{i32 524329, metadata !"tail.c", metadata !"/Users/echeng/LLVM/radars/r7927803/", metadata !3} ; [ DW_TAG_file_type ] diff --git a/test/Transforms/DeadArgElim/keepalive.ll b/test/Transforms/DeadArgElim/keepalive.ll index dc92dc9f17..e41110c96e 100644 --- a/test/Transforms/DeadArgElim/keepalive.ll +++ b/test/Transforms/DeadArgElim/keepalive.ll @@ -1,6 +1,4 @@ -; RUN: opt < %s -deadargelim -S > %t -; RUN: grep "define internal zeroext i32 @test1() nounwind" %t -; RUN: grep "define internal <{ i32, i32 }> @test2" %t +; RUN: opt < %s -deadargelim -S | FileCheck %s %Ty = type <{ i32, i32 }> @@ -9,11 +7,13 @@ ; the function and then changing too much. ; This checks if the return value attributes are not removed +; CHECK: define internal zeroext i32 @test1() #0 define internal zeroext i32 @test1(i32 %DEADARG1) nounwind { ret i32 1 } ; This checks if the struct doesn't get non-packed +; CHECK: define internal <{ i32, i32 }> @test2 define internal <{ i32, i32 }> @test2(i32 %DEADARG1) { ret <{ i32, i32 }> <{ i32 1, i32 2 }> } @@ -28,3 +28,4 @@ define void @caller() { ret void } +; CHECK: attributes #0 = { nounwind } -- cgit v1.2.3