extract.ll 877 B

12345678910111213141516171819202122232425262728293031
  1. ; RUN: llvm-extract -func foo -S < %s | FileCheck %s
  2. ; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
  3. ; RUN: llvm-as < %s > %t
  4. ; RUN: llvm-extract -func foo -S %t | FileCheck %s
  5. ; RUN: llvm-extract -delete -func foo -S %t | FileCheck --check-prefix=DELETE %s
  6. ; llvm-extract uses lazy bitcode loading, so make sure it correctly reads
  7. ; from bitcode files in addition to assembly files.
  8. ; CHECK: define hidden void @foo() comdat($x) {
  9. ; CHECK: ret void
  10. ; CHECK: }
  11. ; The private linkage for foo() should be changed to external linkage and
  12. ; hidden visibility added.
  13. ; DELETE: declare hidden void @foo()
  14. ; DELETE-NOT: comdat
  15. ; DELETE: define void @bar() {
  16. ; DELETE: call void @foo()
  17. ; DELETE: ret void
  18. ; DELETE: }
  19. $x = comdat any
  20. define private void @foo() comdat($x) {
  21. ret void
  22. }
  23. define void @bar() {
  24. call void @foo()
  25. ret void
  26. }