~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/Analysis/CFLAliasAnalysis/va.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

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