From 202087ea2aea6153cdb2376f524f1b38f60c2ce9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 1 Nov 2002 17:29:35 +0000 Subject: [PATCH] Add a testcase cee should eventually pass llvm-svn: 4484 --- .../Transforms/CorrelatedExprs/nullpointer.ll | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/Regression/Transforms/CorrelatedExprs/nullpointer.ll diff --git a/test/Regression/Transforms/CorrelatedExprs/nullpointer.ll b/test/Regression/Transforms/CorrelatedExprs/nullpointer.ll new file mode 100644 index 00000000000..cf2245d09cb --- /dev/null +++ b/test/Regression/Transforms/CorrelatedExprs/nullpointer.ll @@ -0,0 +1,21 @@ +; a load or store of a pointer indicates that the pointer is not null. +; Any succeeding uses of the pointer should get this info + +; RUN: if as < %s | opt -cee -instcombine -simplifycfg | dis | grep br +; RUN: then exit 1 +; RUN: else exit 0 +; RUN: fi + +implementation ; Functions: + +int %nullptr(int* %j) { +bb0: + store int 7, int* %j ; j != null + %cond220 = seteq int* %j, null ; F + br bool %cond220, label %bb3, label %bb4 ; direct branch + +bb3: + ret int 4 ; Dead code +bb4: + ret int 3 ; Live code +}