[llvm-commits] [poolalloc] r115283 - /poolalloc/trunk/test/dsa/local/union_P2I_1.ll

Arushi Aggarwal aggarwa4 at illinois.edu
Thu Sep 30 20:42:43 PDT 2010


Author: aggarwa4
Date: Thu Sep 30 22:42:43 2010
New Revision: 115283

URL: http://llvm.org/viewvc/llvm-project?rev=115283&view=rev
Log:
More Test case for IntToPtr and PtrToInt

Added:
    poolalloc/trunk/test/dsa/local/union_P2I_1.ll

Added: poolalloc/trunk/test/dsa/local/union_P2I_1.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/union_P2I_1.ll?rev=115283&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/local/union_P2I_1.ll (added)
+++ poolalloc/trunk/test/dsa/local/union_P2I_1.ll Thu Sep 30 22:42:43 2010
@@ -0,0 +1,30 @@
+;RUN: dsaopt %s -dsa-local -analyze -check-same-node=main:c:0,main:obj:0
+;RUN: dsaopt %s -dsa-local -analyze -verify-flags "main:c:0+UP2"
+;RUN: dsaopt %s -dsa-local -analyze -check-type=main:obj,0:i32|i32*Array
+
+; ModuleID = 'union_P2I_1.bc'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+%union.UnionType = type { [100 x i32*] }
+
+define i32 @main() nounwind {
+entry:
+  %retval = alloca i32                            ; <i32*> [#uses=1]
+  %obj = alloca %union.UnionType                  ; <%union.UnionType*> [#uses=2]
+  %c = alloca i32*                                ; <i32**> [#uses=1]
+  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
+  %0 = getelementptr inbounds %union.UnionType* %obj, i32 0, i32 0 ; <[100 x i32*]*> [#uses=1]
+  %1 = bitcast [100 x i32*]* %0 to [100 x i32]*   ; <[100 x i32]*> [#uses=1]
+  %2 = getelementptr inbounds [100 x i32]* %1, i64 0, i64 3 ; <i32*> [#uses=1]
+  store i32 123456, i32* %2, align 4
+  %3 = getelementptr inbounds %union.UnionType* %obj, i32 0, i32 0 ; <[100 x i32*]*> [#uses=1]
+  %4 = getelementptr inbounds [100 x i32*]* %3, i64 0, i64 3 ; <i32**> [#uses=1]
+  %5 = load i32** %4, align 8                     ; <i32*> [#uses=1]
+  store i32* %5, i32** %c, align 8
+  br label %return
+
+return:                                           ; preds = %entry
+  %retval1 = load i32* %retval                    ; <i32> [#uses=1]
+  ret i32 %retval1
+}





More information about the llvm-commits mailing list