llvm.org GIT mirror llvm / release_16 test / Other / 2003-02-19-LoopInfoNestingBug.ll
release_16

Tree @release_16 (Download .tar.gz)

2003-02-19-LoopInfoNestingBug.ll @release_16raw · history · blame

; LoopInfo is incorrectly calculating loop nesting!  In this case it doesn't 
; figure out that loop "Inner" should be nested inside of leep "LoopHeader", 
; and instead nests it just inside loop "Top"
;
; RUN: analyze -loops %s | grep '     Loop Containing:[ ]*%Inner'
;

implementation

void %test() {
	br label %Top
Top:
	br label %LoopHeader
Next:
	br bool false, label %Inner, label %Out
Inner:
	br bool false, label %Inner, label %LoopHeader

LoopHeader:
	br label %Next

Out:
	br bool false, label %Top, label %Done

Done:
	ret void
}