~ubuntu-branches/ubuntu/quantal/llvm-3.1/quantal

« back to all changes in this revision

Viewing changes to test/Transforms/InstCombine/call2.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-03-29 19:09:51 UTC
  • Revision ID: package-import@ubuntu.com-20120329190951-aq83ivog4cg8bxun
Tags: upstream-3.1~svn153643
ImportĀ upstreamĀ versionĀ 3.1~svn153643

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: opt < %s -instcombine | llvm-dis
 
2
 
 
3
; This used to crash trying to do a double-to-pointer conversion
 
4
define i32 @bar() {
 
5
entry:
 
6
        %retval = alloca i32, align 4           ; <i32*> [#uses=1]
 
7
        %tmp = call i32 (...)* bitcast (i32 (i8*)* @f to i32 (...)*)( double 3.000000e+00 )             ; <i32> [#uses=0]
 
8
        br label %return
 
9
 
 
10
return:         ; preds = %entry
 
11
        %retval1 = load i32* %retval            ; <i32> [#uses=1]
 
12
        ret i32 %retval1
 
13
}
 
14
 
 
15
define i32 @f(i8* %p) {
 
16
entry:
 
17
        %p_addr = alloca i8*            ; <i8**> [#uses=1]
 
18
        %retval = alloca i32, align 4           ; <i32*> [#uses=1]
 
19
        store i8* %p, i8** %p_addr
 
20
        br label %return
 
21
 
 
22
return:         ; preds = %entry
 
23
        %retval1 = load i32* %retval            ; <i32> [#uses=1]
 
24
        ret i32 %retval1
 
25
}