cfi_endproc.ll 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ; RUN: llvm-as < %s >%t1
  2. ; RUN: llvm-lto -o %t2 %t1
  3. ; RUN: llvm-nm %t2 | FileCheck %s -check-prefix=NOEXPORT
  4. ; RUN: llvm-lto -o %t3 -exported-symbol=main %t1
  5. ; RUN: llvm-nm %t3 | FileCheck %s -check-prefix=EXPORT
  6. target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
  7. target triple = "x86_64-unknown-linux-gnu"
  8. module asm ".text"
  9. module asm ".align 16, 0x90"
  10. module asm ".type PR14512, @function"
  11. module asm "PR14512:.cfi_startproc"
  12. module asm "ret"
  13. module asm ".cfi_endproc"
  14. declare void @PR14512()
  15. ; Without -exported-symbol, main should be eliminated by LTO.
  16. ; With -exported-symbol=main, main should be preserved by LTO.
  17. define i32 @main(i32 %argc, i8** %argv) {
  18. ; NOEXPORT-NOT: main
  19. ; EXPORT: main
  20. call void @PR14512()
  21. ret i32 0
  22. }
  23. ; RUN: llvm-lto -o %t -dso-symbol=zed1 -dso-symbol=zed2 %t1 -O0
  24. ; RUN: llvm-nm %t | FileCheck %s -check-prefix=ZED1_AND_ZED2
  25. ; ZED1_AND_ZED2: V zed1
  26. @zed1 = linkonce_odr global i32 42
  27. define i32* @get_zed1() {
  28. ret i32* @zed1
  29. }
  30. ; ZED1_AND_ZED2: d zed2
  31. @zed2 = linkonce_odr unnamed_addr global i32 42
  32. define i32 @useZed2() {
  33. %x = load i32, i32* @zed2
  34. ret i32 %x
  35. }