1 ; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
3 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"
4 target triple = "i386-apple-darwin7"
6 define i8 @test(i8* %P) nounwind {
12 %0 = call {}* @llvm.invariant.start(i64 32, i8* %P)
13 %1 = tail call i32 @foo(i8* %P)
14 call void @llvm.invariant.end({}* %0, i64 32, i8* %P)
19 define i8 @test2(i8* %P) nounwind {
26 %0 = call {}* @llvm.invariant.start(i64 32, i8* %P)
27 %1 = tail call i32 @bar(i8* %P)
28 call void @llvm.invariant.end({}* %0, i64 32, i8* %P)
33 declare i32 @foo(i8*) nounwind
34 declare i32 @bar(i8*) nounwind readonly
35 declare {}* @llvm.invariant.start(i64 %S, i8* nocapture %P) readonly
36 declare void @llvm.invariant.end({}* %S, i64 %SS, i8* nocapture %P)