66 lines · plain
1; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -S -passes=inline | FileCheck %s2; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -S -passes='cgscc(inline)' | FileCheck %s3; Check that we only inline when we have compatible target attributes.4 5define i32 @foo() #0 {6entry:7 %call = call i32 (...) @baz()8 ret i32 %call9; CHECK-LABEL: foo10; CHECK: call i32 (...) @baz()11}12declare i32 @baz(...) #013 14define i32 @bar() #1 {15entry:16 %call = call i32 @foo()17 ret i32 %call18; CHECK-LABEL: bar19; CHECK: call i32 (...) @baz()20}21 22define i32 @qux() #0 {23entry:24 %call = call i32 @bar()25 ret i32 %call26; CHECK-LABEL: qux27; CHECK: call i32 @bar()28}29 30define i32 @quux() #3 {31entry:32 %call = call i32 (...) @baz()33 ret i32 %call34; CHECK-LABEL: quux35; CHECK: call i32 (...) @baz()36}37 38define i32 @strict_align() #2 {39entry:40 %call = call i32 @foo()41 ret i32 %call42; CHECK-LABEL: strict_align43; CHECK: call i32 (...) @baz()44}45 46define i32 @execute_only1() #3 {47entry:48 %call = call i32 @foo()49 ret i32 %call50; CHECK-LABEL: execute_only151; CHECK: call i32 @foo()52}53 54define i32 @execute_only2() #0 {55entry:56 %call = call i32 @quux()57 ret i32 %call58; CHECK-LABEL: execute_only259; CHECK: call i32 (...) @baz()60}61 62attributes #0 = { "target-cpu"="generic" "target-features"="+crc,+neon" }63attributes #1 = { "target-cpu"="generic" "target-features"="+crc,+neon,+crypto" }64attributes #2 = { "target-cpu"="generic" "target-features"="+crc,+neon,+strict-align" }65attributes #3 = { "target-cpu"="generic" "target-features"="+crc,+neon,+execute-only" }66