2016-03-26 02:01:37 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by update_test_checks.py
|
|
|
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
2007-09-07 13:33:03 +08:00
|
|
|
|
2016-03-26 02:01:37 +08:00
|
|
|
@x = weak global i32 0
|
2007-09-07 13:33:03 +08:00
|
|
|
|
|
|
|
define void @self_assign_1() {
|
2016-03-26 02:01:37 +08:00
|
|
|
; CHECK-LABEL: @self_assign_1(
|
2016-04-06 01:24:54 +08:00
|
|
|
; CHECK-NEXT: entry:
|
|
|
|
; CHECK-NEXT: [[TMP:%.*]] = load volatile i32, i32* @x, align 4
|
2016-03-26 02:01:37 +08:00
|
|
|
; CHECK-NEXT: store volatile i32 [[TMP]], i32* @x, align 4
|
|
|
|
; CHECK-NEXT: br label %return
|
|
|
|
; CHECK: return:
|
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
2007-09-07 13:33:03 +08:00
|
|
|
entry:
|
2016-04-06 01:24:54 +08:00
|
|
|
%tmp = load volatile i32, i32* @x
|
|
|
|
store volatile i32 %tmp, i32* @x
|
|
|
|
br label %return
|
2007-09-07 13:33:03 +08:00
|
|
|
|
2016-03-26 02:01:37 +08:00
|
|
|
return:
|
2016-04-06 01:24:54 +08:00
|
|
|
ret void
|
2007-09-07 13:33:03 +08:00
|
|
|
}
|