• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -disable-basic-aa -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
9define 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
29declare void @llvm.va_start(i8*)
30declare void @llvm.va_copy(i8*, i8*)
31declare void @llvm.va_end(i8*)
32
33