blob: d23208166136a5a360e5a4a50e3f73ac15912610 [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -dse %s -S | FileCheck %s
target datalayout = "e-m:o-p:32:32-Fi8-i64:64-a:0:32-n32-S128"
define void @widget(i8* %ptr) {
; CHECK-LABEL: @widget(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[PTR1:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i32 4
; CHECK-NEXT: [[PTR1_CAST:%.*]] = bitcast i8* [[PTR1]] to i32*
; CHECK-NEXT: store atomic i32 0, i32* [[PTR1_CAST]] monotonic, align 4
; CHECK-NEXT: [[PTR2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i32 0
; CHECK-NEXT: [[PTR2_CAST:%.*]] = bitcast i8* [[PTR2]] to i64**
; CHECK-NEXT: store i64* null, i64** [[PTR2_CAST]], align 4
; CHECK-NEXT: ret void
;
bb:
%ptr1 = getelementptr inbounds i8, i8* %ptr, i32 4
%ptr1.cast = bitcast i8* %ptr1 to i32*
store atomic i32 0, i32* %ptr1.cast monotonic, align 4
%ptr2 = getelementptr inbounds i8, i8* %ptr, i32 0
%ptr2.cast = bitcast i8* %ptr2 to i64**
store i64* null, i64** %ptr2.cast, align 4
ret void
}