summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-04-01 21:41:15 +0000
committerManman Ren <manman.ren@gmail.com>2016-04-01 21:41:15 +0000
commit9bfd0d03e92d4bbb0ebf6171f5e0692edf9820c3 (patch)
tree9a24f292b9df7e108e4a60d458c5668a2409157d /llvm/test/Bitcode
parenta3d15f3a5e645e75093f2f5f2b2065bca396c16e (diff)
downloadbcm5719-llvm-9bfd0d03e92d4bbb0ebf6171f5e0692edf9820c3.tar.gz
bcm5719-llvm-9bfd0d03e92d4bbb0ebf6171f5e0692edf9820c3.zip
Swift Calling Convention: add swifterror attribute.
A ``swifterror`` attribute can be applied to a function parameter or an AllocaInst. This commit does not include any target-specific change. The target-specific optimization will come as a follow-up patch. Differential Revision: http://reviews.llvm.org/D18092 llvm-svn: 265189
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/attributes.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/attributes.ll b/llvm/test/Bitcode/attributes.ll
index 74b0386c33d..dec3608fb2b 100644
--- a/llvm/test/Bitcode/attributes.ll
+++ b/llvm/test/Bitcode/attributes.ll
@@ -293,6 +293,31 @@ define void @f50(i8* swiftself)
ret void;
}
+; CHECK: define i32 @f51(i8** swifterror)
+define i32 @f51(i8** swifterror)
+{
+ ret i32 0
+}
+
+; CHECK: define i32 @f52(i32, i8** swifterror)
+define i32 @f52(i32, i8** swifterror)
+{
+ ret i32 0
+}
+
+%swift_error = type {i64, i8}
+declare float @foo(%swift_error** swifterror %error_ptr_ref)
+
+; CHECK: define float @f53
+; CHECK: alloca swifterror
+define float @f53(i8* %error_ref) {
+entry:
+ %error_ptr_ref = alloca swifterror %swift_error*
+ store %swift_error* null, %swift_error** %error_ptr_ref
+ %call = call float @foo(%swift_error** swifterror %error_ptr_ref)
+ ret float 1.0
+}
+
; CHECK: attributes #0 = { noreturn }
; CHECK: attributes #1 = { nounwind }
; CHECK: attributes #2 = { readnone }
OpenPOWER on IntegriCloud