2016-07-18 07:21:26 +08:00
|
|
|
; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
|
2008-07-03 01:20:16 +08:00
|
|
|
; PR2503
|
2008-11-30 05:21:48 +08:00
|
|
|
|
2008-07-03 01:20:16 +08:00
|
|
|
@g_3 = external global i8 ; <i8*> [#uses=2]
|
|
|
|
|
2013-11-12 06:00:23 +08:00
|
|
|
define i8 @func_1(i32 %x, i32 %y) nounwind {
|
2008-07-03 01:20:16 +08:00
|
|
|
entry:
|
2011-05-22 15:02:43 +08:00
|
|
|
%A = alloca i8
|
2013-11-12 06:00:23 +08:00
|
|
|
%cmp = icmp eq i32 %x, %y
|
|
|
|
br i1 %cmp, label %ifelse, label %ifthen
|
2008-07-03 01:20:16 +08:00
|
|
|
|
|
|
|
ifthen: ; preds = %entry
|
|
|
|
br label %ifend
|
|
|
|
|
|
|
|
ifelse: ; preds = %entry
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp3 = load i8, i8* @g_3 ; <i8> [#uses=0]
|
2011-05-22 15:02:43 +08:00
|
|
|
store i8 %tmp3, i8* %A
|
2008-07-03 01:20:16 +08:00
|
|
|
br label %afterfor
|
|
|
|
|
|
|
|
forcond: ; preds = %forinc
|
|
|
|
br i1 false, label %afterfor, label %forbody
|
|
|
|
|
|
|
|
forbody: ; preds = %forcond
|
|
|
|
br label %forinc
|
|
|
|
|
|
|
|
forinc: ; preds = %forbody
|
|
|
|
br label %forcond
|
|
|
|
|
|
|
|
afterfor: ; preds = %forcond, %forcond.thread
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp10 = load i8, i8* @g_3 ; <i8> [#uses=0]
|
2008-11-30 05:21:48 +08:00
|
|
|
ret i8 %tmp10
|
2016-07-18 07:21:26 +08:00
|
|
|
; CHECK: ret i8 %tmp3
|
2008-07-03 01:20:16 +08:00
|
|
|
|
|
|
|
ifend: ; preds = %afterfor, %ifthen
|
2008-11-30 05:21:48 +08:00
|
|
|
ret i8 0
|
2008-07-03 01:20:16 +08:00
|
|
|
}
|