37 lines · plain
1; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -S -passes=inline | FileCheck %s2; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -S -passes='cgscc(inline)' | FileCheck %s3; Check that we only inline when we have compatible target attributes.4; X86 has implemented a target attribute that will verify that the attribute5; sets are compatible.6 7target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"8target triple = "x86_64-unknown-linux-gnu"9 10define i32 @foo() #0 {11entry:12 %call = call i32 (...) @baz()13 ret i32 %call14; CHECK-LABEL: foo15; CHECK: call i32 (...) @baz()16}17declare i32 @baz(...) #018 19define i32 @bar() #1 {20entry:21 %call = call i32 @foo()22 ret i32 %call23; CHECK-LABEL: bar24; CHECK: call i32 (...) @baz()25}26 27define i32 @qux() #0 {28entry:29 %call = call i32 @bar()30 ret i32 %call31; CHECK-LABEL: qux32; CHECK: call i32 @bar()33}34 35attributes #0 = { "target-cpu"="x86-64" "target-features"="+sse,+sse2" }36attributes #1 = { "target-cpu"="x86-64" "target-features"="+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3" }37