2002-11-01 17:29:35 +00:00
|
|
|
; a load or store of a pointer indicates that the pointer is not null.
|
|
|
|
; Any succeeding uses of the pointer should get this info
|
2004-11-06 20:38:27 +00:00
|
|
|
;
|
|
|
|
; XFAIL: *
|
2003-09-16 15:29:54 +00:00
|
|
|
; RUN: llvm-as < %s | opt -cee -instcombine -simplifycfg | llvm-dis | not grep br
|
2002-11-01 17:29:35 +00:00
|
|
|
|
|
|
|
implementation ; Functions:
|
|
|
|
|
2004-05-27 07:37:45 +00:00
|
|
|
declare void %foo()
|
|
|
|
declare void %bar()
|
|
|
|
|
2002-11-01 17:29:35 +00:00
|
|
|
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:
|
2004-05-27 07:37:45 +00:00
|
|
|
call void %foo()
|
2002-11-01 17:29:35 +00:00
|
|
|
ret int 4 ; Dead code
|
|
|
|
bb4:
|
2004-05-27 07:37:45 +00:00
|
|
|
call void %bar()
|
2002-11-01 17:29:35 +00:00
|
|
|
ret int 3 ; Live code
|
|
|
|
}
|