diff options
author | Eric Christopher <echristo@apple.com> | 2010-04-12 04:48:00 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-04-12 04:48:00 +0000 |
commit | 71fdfba3f452e075119fda474d8a26d7858aea7c (patch) | |
tree | 0237623f45392f1c26d4ec8a14e859f329ed759a /test/Transforms | |
parent | e0c1c1805e6a7522bcf5ac444078b8b7ff560a2c (diff) | |
download | external_llvm-71fdfba3f452e075119fda474d8a26d7858aea7c.zip external_llvm-71fdfba3f452e075119fda474d8a26d7858aea7c.tar.gz external_llvm-71fdfba3f452e075119fda474d8a26d7858aea7c.tar.bz2 |
Verify function prototypes before trying to optimize functions. We also
need TargetData, just return false if we don't have it.
Update testcases accordingly.
Fixes PR6807.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/objsize.ll | 10 | ||||
-rw-r--r-- | test/Transforms/InstCombine/strcpy_chk.ll | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll index d74312d..52294d8 100644 --- a/test/Transforms/InstCombine/objsize.ll +++ b/test/Transforms/InstCombine/objsize.ll @@ -111,10 +111,10 @@ define i32 @test4() nounwind ssp { entry: %0 = alloca %struct.data, align 8 %1 = bitcast %struct.data* %0 to i8* - %2 = call i64 @llvm.objectsize.i64(i8* %1, i1 false) nounwind + %2 = call i32 @llvm.objectsize.i32(i8* %1, i1 false) nounwind ; CHECK-NOT: @llvm.objectsize -; CHECK: @llvm.memset.p0i8.i64(i8* %1, i8 0, i64 1824, i32 8, i1 false) - %3 = call i8* @__memset_chk(i8* %1, i32 0, i64 1824, i64 %2) nounwind +; CHECK: @llvm.memset.p0i8.i32(i8* %1, i8 0, i32 1824, i32 8, i1 false) + %3 = call i8* @__memset_chk(i8* %1, i32 0, i32 1824, i32 %2) nounwind ret i32 0 } @@ -149,6 +149,4 @@ declare i8* @__memset_chk(i8*, i32, i64, i64) nounwind declare noalias i8* @malloc(i32) nounwind -declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly - -declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readonly +declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly
\ No newline at end of file diff --git a/test/Transforms/InstCombine/strcpy_chk.ll b/test/Transforms/InstCombine/strcpy_chk.ll index a20a13c..8835a0b 100644 --- a/test/Transforms/InstCombine/strcpy_chk.ll +++ b/test/Transforms/InstCombine/strcpy_chk.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" @a = common global [60 x i8] zeroinitializer, align 1 ; <[60 x i8]*> [#uses=1] @.str = private constant [8 x i8] c"abcdefg\00" ; <[8 x i8]*> [#uses=1] |