va.ll 761 B

1234567891011121314151617181920212223242526272829
  1. ; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
  2. ; CHECK-LABEL: Function: test1
  3. ; CHECK: 0 no alias responses
  4. define i32 @test1(i32 %X, ...) {
  5. ; Initialize variable argument processing
  6. %ap = alloca i8*
  7. %ap2 = bitcast i8** %ap to i8*
  8. call void @llvm.va_start(i8* %ap2)
  9. ; Read a single integer argument
  10. %tmp = va_arg i8** %ap, i32
  11. ; Demonstrate usage of llvm.va_copy and llvm.va_end
  12. %aq = alloca i8*
  13. %aq2 = bitcast i8** %aq to i8*
  14. call void @llvm.va_copy(i8* %aq2, i8* %ap2)
  15. call void @llvm.va_end(i8* %aq2)
  16. ; Stop processing of arguments.
  17. call void @llvm.va_end(i8* %ap2)
  18. ret i32 %tmp
  19. }
  20. declare void @llvm.va_start(i8*)
  21. declare void @llvm.va_copy(i8*, i8*)
  22. declare void @llvm.va_end(i8*)