DeleteThrowableInst.ll
1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -basicaa -dse -S | FileCheck %s
declare i8* @_Znwj(i32) local_unnamed_addr
declare void @foo() readnone
define void @test1(i8** %ptr) {
; CHECK-LABEL: @test1(
; CHECK-NEXT: [[VAL:%.*]] = inttoptr i64 23452 to i8*
; CHECK-NEXT: store i8* [[VAL]], i8** [[PTR:%.*]]
; CHECK-NEXT: ret void
;
%val = inttoptr i64 23452 to i8*
store i8* %val, i8** %ptr
%call = call i8* @_Znwj(i32 1)
store i8* %call, i8** %ptr
store i8* %val, i8** %ptr
ret void
}
define void @test2(i8** %ptr, i8* %p1, i8* %p2) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: [[VAL:%.*]] = inttoptr i64 23452 to i8*
; CHECK-NEXT: store i8* [[VAL]], i8** [[PTR:%.*]]
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: store i8* [[P1:%.*]], i8** [[PTR]]
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: store i8* [[VAL]], i8** [[PTR]]
; CHECK-NEXT: ret void
;
%val = inttoptr i64 23452 to i8*
store i8* %val, i8** %ptr
call void @foo()
store i8* %p1, i8** %ptr
call void @foo()
store i8* %p2, i8** %ptr
%call = call i8* @_Znwj(i32 1)
store i8* %call, i8** %ptr
store i8* %val, i8** %ptr
ret void
}