inline-target-attr.ll 927 B

1234567891011121314151617181920212223242526272829303132333435
  1. ; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -S -inline | FileCheck %s
  2. ; Check that we only inline when we have compatible target attributes.
  3. ; X86 has implemented a target attribute that will verify that the attribute
  4. ; sets are compatible.
  5. target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  6. target triple = "x86_64-unknown-linux-gnu"
  7. define i32 @foo() #0 {
  8. entry:
  9. %call = call i32 (...) @baz()
  10. ret i32 %call
  11. ; CHECK-LABEL: foo
  12. ; CHECK: call i32 (...) @baz()
  13. }
  14. declare i32 @baz(...) #0
  15. define i32 @bar() #1 {
  16. entry:
  17. %call = call i32 @foo()
  18. ret i32 %call
  19. ; CHECK-LABEL: bar
  20. ; CHECK: call i32 (...) @baz()
  21. }
  22. define i32 @qux() #0 {
  23. entry:
  24. %call = call i32 @bar()
  25. ret i32 %call
  26. ; CHECK-LABEL: qux
  27. ; CHECK: call i32 @bar()
  28. }
  29. attributes #0 = { "target-cpu"="x86-64" "target-features"="+sse,+sse2" }
  30. attributes #1 = { "target-cpu"="x86-64" "target-features"="+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3" }