[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / Transforms / DeadArgElim / deadretval.ll
blob3f418bf8b5e464b4cd8c3ef68558317bf52bebc3
1 ; RUN: opt < %s -passes=deadargelim -S | FileCheck %s
3 @g0 = global i8 0, align 8
5 ; CHECK-NOT: DEAD
7 ; Dead arg only used by dead retval
8 define internal i32 @test(i32 %DEADARG) {
9         ret i32 %DEADARG
12 define i32 @test2(i32 %A) {
13         %DEAD = call i32 @test( i32 %A )                ; <i32> [#uses=0]
14         ret i32 123
17 define i32 @test3() {
18         %X = call i32 @test2( i32 3232 )                ; <i32> [#uses=1]
19         %Y = add i32 %X, -123           ; <i32> [#uses=1]
20         ret i32 %Y
23 ; The callee function's return type shouldn't be changed if the call result is
24 ; used.
26 ; CHECK-LABEL: define internal i8* @callee4()
28 define internal i8* @callee4(i8* %a0) {
29   ret i8* @g0;
32 declare void @llvm.objc.clang.arc.noop.use(...)
34 ; CHECK-LABEL: define i8* @test4(
35 ; CHECK: tail call i8* @callee4() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
37 define i8* @test4() {
38   %call = tail call i8* @callee4(i8* @g0) [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
39   call void (...) @llvm.objc.clang.arc.noop.use(i8* %call)
40   ret i8* @g0
43 declare i8* @llvm.objc.retainAutoreleasedReturnValue(i8*)