1 ; To test that asan does not break the musttail call contract.
3 ; RUN: opt < %s -passes=asan -S | FileCheck %s
5 define internal i32 @foo(ptr %p) sanitize_address {
10 declare void @alloca_test_use(ptr)
11 define i32 @call_foo(ptr %a) sanitize_address {
12 %x = alloca [10 x i8], align 1
13 call void @alloca_test_use(ptr %x)
14 %r = musttail call i32 @foo(ptr %a)
18 ; CHECK-LABEL: define i32 @call_foo(ptr %a)
19 ; CHECK: %r = musttail call i32 @foo(ptr %a)
20 ; CHECK-NEXT: ret i32 %r
23 define i32 @call_foo_cast(ptr %a) sanitize_address {
24 %x = alloca [10 x i8], align 1
25 call void @alloca_test_use(ptr %x)
26 %r = musttail call i32 @foo(ptr %a)
27 %t = bitcast i32 %r to i32
31 ; CHECK-LABEL: define i32 @call_foo_cast(ptr %a)
32 ; CHECK: %r = musttail call i32 @foo(ptr %a)
33 ; CHECK-NEXT: %t = bitcast i32 %r to i32
34 ; CHECK-NEXT: ret i32 %t