summaryrefslogtreecommitdiff
path: root/test/Transforms/FunctionAttrs
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-20 07:21:42 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-20 07:21:42 +0000
commit7ab6c76ad1cbf36284ca5b6bd5ee33c625fe3e60 (patch)
tree3cc081ac6ea575accea7f12c2353aa175dfd5025 /test/Transforms/FunctionAttrs
parent9030fc22dd73684901ecb749c9688e289bd1a777 (diff)
downloadllvm-7ab6c76ad1cbf36284ca5b6bd5ee33c625fe3e60.tar.gz
llvm-7ab6c76ad1cbf36284ca5b6bd5ee33c625fe3e60.tar.bz2
llvm-7ab6c76ad1cbf36284ca5b6bd5ee33c625fe3e60.tar.xz
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
Diffstat (limited to 'test/Transforms/FunctionAttrs')
-rw-r--r--test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll10
-rw-r--r--test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll6
-rw-r--r--test/Transforms/FunctionAttrs/atomic.ll6
3 files changed, 14 insertions, 8 deletions
diff --git a/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll b/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll
index 2e88a135a5..36a7658734 100644
--- a/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll
+++ b/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll
@@ -1,22 +1,24 @@
; RUN: opt < %s -basicaa -functionattrs -S | FileCheck %s
@x = global i32 0
-; CHECK: declare i32 @e() readnone
+; CHECK: declare i32 @e() #0
declare i32 @e() readnone
-; CHECK: define i32 @f() readnone
+; CHECK: define i32 @f() #0
define i32 @f() {
%tmp = call i32 @e( ) ; <i32> [#uses=1]
ret i32 %tmp
}
-; CHECK: define i32 @g() readnone
+; CHECK: define i32 @g() #0
define i32 @g() readonly {
ret i32 0
}
-; CHECK: define i32 @h() readnone
+; CHECK: define i32 @h() #0
define i32 @h() readnone {
%tmp = load i32* @x ; <i32> [#uses=1]
ret i32 %tmp
}
+
+; CHECK: attributes #0 = { readnone }
diff --git a/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll b/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll
index 0b03fc87dd..d8256ae8e6 100644
--- a/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll
+++ b/test/Transforms/FunctionAttrs/2008-09-03-ReadOnly.ll
@@ -1,11 +1,13 @@
; RUN: opt < %s -basicaa -functionattrs -S | FileCheck %s
-; CHECK: define i32 @f() readonly
+; CHECK: define i32 @f() #0
define i32 @f() {
entry:
%tmp = call i32 @e( )
ret i32 %tmp
}
-; CHECK: declare i32 @e() readonly
+; CHECK: declare i32 @e() #0
declare i32 @e() readonly
+
+; CHECK: attributes #0 = { readonly }
diff --git a/test/Transforms/FunctionAttrs/atomic.ll b/test/Transforms/FunctionAttrs/atomic.ll
index df916e265c..027ee0fd06 100644
--- a/test/Transforms/FunctionAttrs/atomic.ll
+++ b/test/Transforms/FunctionAttrs/atomic.ll
@@ -3,7 +3,7 @@
; Atomic load/store to local doesn't affect whether a function is
; readnone/readonly.
define i32 @test1(i32 %x) uwtable ssp {
-; CHECK: define i32 @test1(i32 %x) readnone ssp uwtable {
+; CHECK: define i32 @test1(i32 %x) #0 {
entry:
%x.addr = alloca i32, align 4
store atomic i32 %x, i32* %x.addr seq_cst, align 4
@@ -13,9 +13,11 @@ entry:
; A function with an Acquire load is not readonly.
define i32 @test2(i32* %x) uwtable ssp {
-; CHECK: define i32 @test2(i32* nocapture %x) ssp uwtable {
+; CHECK: define i32 @test2(i32* nocapture %x) #1 {
entry:
%r = load atomic i32* %x seq_cst, align 4
ret i32 %r
}
+; CHECK: attributes #0 = { readnone ssp uwtable }
+; CHECK: attributes #1 = { ssp uwtable }