2009-01-02-LocalStores.ll 484 B

1234567891011121314151617181920212223
  1. ; RUN: opt < %s -functionattrs -S | FileCheck %s
  2. ; CHECK: define i32* @a(i32** nocapture readonly %p)
  3. define i32* @a(i32** %p) {
  4. %tmp = load i32*, i32** %p
  5. ret i32* %tmp
  6. }
  7. ; CHECK: define i32* @b(i32* %q)
  8. define i32* @b(i32 *%q) {
  9. %mem = alloca i32*
  10. store i32* %q, i32** %mem
  11. %tmp = call i32* @a(i32** %mem)
  12. ret i32* %tmp
  13. }
  14. ; CHECK: define i32* @c(i32* readnone %r)
  15. @g = global i32 0
  16. define i32* @c(i32 *%r) {
  17. %a = icmp eq i32* %r, null
  18. store i32 1, i32* @g
  19. ret i32* %r
  20. }