Home | History | Annotate | Download | only in Steensgaard
      1 ; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
      2 
      3 ; CHECK-LABEL: Function: test1
      4 ; CHECK: MayAlias: i32* %X, i32* %tmp
      5 ; CHECK: MayAlias: i32* %tmp, i8** %ap
      6 ; CHECK: NoAlias: i8** %ap, i8** %aq
      7 ; CHECK: MayAlias: i32* %tmp, i8** %aq
      8 
      9 define i32* @test1(i32* %X, ...) {
     10   ; Initialize variable argument processing
     11   %ap = alloca i8*
     12   %ap2 = bitcast i8** %ap to i8*
     13   call void @llvm.va_start(i8* %ap2)
     14 
     15   ; Read a single pointer argument
     16   %tmp = va_arg i8** %ap, i32*
     17 
     18   ; Demonstrate usage of llvm.va_copy and llvm.va_end
     19   %aq = alloca i8*
     20   %aq2 = bitcast i8** %aq to i8*
     21   call void @llvm.va_copy(i8* %aq2, i8* %ap2)
     22   call void @llvm.va_end(i8* %aq2)
     23 
     24   ; Stop processing of arguments.
     25   call void @llvm.va_end(i8* %ap2)
     26   ret i32* %tmp
     27 }
     28 
     29 declare void @llvm.va_start(i8*)
     30 declare void @llvm.va_copy(i8*, i8*)
     31 declare void @llvm.va_end(i8*)
     32 
     33