1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
6 define void @self_assign_1() {
7 ; CHECK-LABEL: @self_assign_1(
9 ; CHECK-NEXT: [[TMP:%.*]] = load volatile i32, ptr @x, align 4
10 ; CHECK-NEXT: store volatile i32 [[TMP]], ptr @x, align 4
11 ; CHECK-NEXT: br label [[RETURN:%.*]]
13 ; CHECK-NEXT: ret void
16 %tmp = load volatile i32, ptr @x
17 store volatile i32 %tmp, ptr @x
24 define void @volatile_store_before_unreachable(i1 %c, ptr %p) {
25 ; CHECK-LABEL: @volatile_store_before_unreachable(
26 ; CHECK-NEXT: br i1 [[C:%.*]], label [[TRUE:%.*]], label [[FALSE:%.*]]
28 ; CHECK-NEXT: store volatile i8 0, ptr [[P:%.*]], align 1
29 ; CHECK-NEXT: unreachable
31 ; CHECK-NEXT: ret void
33 br i1 %c, label %true, label %false
36 store volatile i8 0, ptr %p