1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
3 %swift_error = type {i64, i8}
5 ; CHECK: swifterror value can only be loaded and stored from, or as a swifterror argument!
6 ; CHECK: %swift_error** %error_ptr_ref
7 ; CHECK: %t = getelementptr inbounds %swift_error*, %swift_error** %error_ptr_ref, i64 1
8 define float @foo(%swift_error** swifterror %error_ptr_ref) {
9 %t = getelementptr inbounds %swift_error*, %swift_error** %error_ptr_ref, i64 1
13 ; CHECK: swifterror argument for call has mismatched alloca
14 ; CHECK: %error_ptr_ref = alloca %swift_error*
15 ; CHECK: %call = call float @foo(%swift_error** swifterror %error_ptr_ref)
16 define float @caller(i8* %error_ref) {
18 %error_ptr_ref = alloca %swift_error*
19 store %swift_error* null, %swift_error** %error_ptr_ref
20 %call = call float @foo(%swift_error** swifterror %error_ptr_ref)
24 ; CHECK: Cannot have multiple 'swifterror' parameters!
25 declare void @a(i32** swifterror %a, i32** swifterror %b)
27 ; CHECK: Attribute 'swifterror' only applies to parameters with pointer type!
28 declare void @b(i32 swifterror %a)
30 ; CHECK: Attribute 'swifterror' only applies to parameters with pointer to pointer type!
31 declare void @c(i32* swifterror %a)