1 ; RUN: llvm-link %s %p/Inputs/drop-attribute.ll -S -o - | FileCheck %s
3 ; Test case that checks that nocallback attribute is dropped during linking.
5 ; CHECK: define i32 @main()
7 ; CHECK-NEXT: call void @test_nocallback_definition()
8 ; Test that checks that nocallback attribute on a call-site in a call instruction is dropped.
9 ; CHECK-NEXT: call void @test_nocallback_call_site(){{$}}
10 ; CHECK-NEXT: %0 = call float @llvm.sqrt.f32(float undef)
11 ; CHECK-NEXT: call void @test_nocallback_declaration_definition_not_linked_in()
12 ; CHECK-NEXT: call void @test_nocallback_declaration_definition_linked_in()
13 ; Test that checks that nocallback attribute on a call-site in an invoke instruction is dropped.
14 ; CHECK-NEXT: invoke void @test_nocallback_call_site(){{$}}
15 define i32 @main() personality i8 0 {
17 call void @test_nocallback_definition()
18 call void @test_nocallback_call_site() nocallback
19 call float @llvm.sqrt.f32(float undef)
20 call void @test_nocallback_declaration_definition_not_linked_in()
21 call void @test_nocallback_declaration_definition_linked_in()
22 invoke void @test_nocallback_call_site() nocallback
23 to label %ret unwind label %unw
25 %tmp = landingpad i8 cleanup
31 ; Test that checks that nocallback attribute on a definition is dropped.
32 ; CHECK: define void @test_nocallback_definition()
33 define void @test_nocallback_definition() nocallback {
37 ; Test that checks that nocallback attribute on a call site is dropped.
38 ; CHECK: declare void @test_nocallback_call_site(){{$}}
39 declare void @test_nocallback_call_site()
41 ; Test that checks that nocallback attribute on an intrinsic is NOT dropped.
42 ; CHECK: ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn
43 ; CHECK-NEXT: declare float @llvm.sqrt.f32(float) #0
44 declare float @llvm.sqrt.f32(float) nocallback
46 ; Test that checks that nocallback attribute on a declaration when a definition is not linked in is dropped.
47 ; CHECK: declare void @test_nocallback_declaration_definition_not_linked_in(){{$}}
48 declare void @test_nocallback_declaration_definition_not_linked_in() nocallback
50 ; Test that checks that nocallback attribute on a declaration when a definition is linked in is dropped.
51 ; CHECK: define void @test_nocallback_declaration_definition_linked_in() {{{$}}
52 declare void @test_nocallback_declaration_definition_linked_in() nocallback