Don't make assumptions about the name of private global variables.
[oota-llvm.git] / test / Transforms / TailCallElim / reorder_load.ll
index 7f5c36e4a207bf66611db5ef76a5adda27671406..2e350d662a39eb27726db69d4f772aad89329ff1 100644 (file)
@@ -1,6 +1,8 @@
-; RUN: opt < %s -tailcallelim -S | not grep call
+; RUN: opt < %s -tailcallelim -S | FileCheck %s
 ; PR4323
 
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
 ; Several cases where tail call elimination should move the load above the call,
 ; then eliminate the tail recursion.
 
 ; This load can be moved above the call because the function won't write to it
 ; and the call has no side effects.
 define fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly {
+; CHECK-LABEL: @raise_load_1(
+; CHECK-NOT: call
+; CHECK: load i32*
+; CHECK-NOT: call
+; CHECK: }
 entry:
        %tmp2 = icmp sge i32 %start_arg, %a_len_arg             ; <i1> [#uses=1]
        br i1 %tmp2, label %if, label %else
@@ -31,6 +38,11 @@ else:                ; preds = %entry
 ; This load can be moved above the call because the function won't write to it
 ; and the load provably can't trap.
 define fastcc i32 @raise_load_2(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
+; CHECK-LABEL: @raise_load_2(
+; CHECK-NOT: call
+; CHECK: load i32*
+; CHECK-NOT: call
+; CHECK: }
 entry:
        %tmp2 = icmp sge i32 %start_arg, %a_len_arg             ; <i1> [#uses=1]
        br i1 %tmp2, label %if, label %else
@@ -57,6 +69,11 @@ recurse:             ; preds = %else
 ; This load can be safely moved above the call (even though it's from an
 ; extern_weak global) because the call has no side effects.
 define fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly {
+; CHECK-LABEL: @raise_load_3(
+; CHECK-NOT: call
+; CHECK: load i32*
+; CHECK-NOT: call
+; CHECK: }
 entry:
        %tmp2 = icmp sge i32 %start_arg, %a_len_arg             ; <i1> [#uses=1]
        br i1 %tmp2, label %if, label %else
@@ -77,6 +94,12 @@ else:                ; preds = %entry
 ; unknown pointer (which normally means it might trap) because the first load
 ; proves it doesn't trap.
 define fastcc i32 @raise_load_4(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) readonly {
+; CHECK-LABEL: @raise_load_4(
+; CHECK-NOT: call
+; CHECK: load i32*
+; CHECK-NEXT: load i32*
+; CHECK-NOT: call
+; CHECK: }
 entry:
        %tmp2 = icmp sge i32 %start_arg, %a_len_arg             ; <i1> [#uses=1]
        br i1 %tmp2, label %if, label %else