31 lines · plain
1; To test that __tsan_func_exit always happen before musttaill call and no exception handling code.2; RUN: opt < %s -passes=tsan -S | FileCheck %s3 4define internal i32 @preallocated_musttail(ptr preallocated(i32) %p) sanitize_thread {5 %rv = load i32, ptr %p6 ret i32 %rv7}8 9define i32 @call_preallocated_musttail(ptr preallocated(i32) %a) sanitize_thread {10 %r = musttail call i32 @preallocated_musttail(ptr preallocated(i32) %a)11 ret i32 %r12}13 14; CHECK-LABEL: define i32 @call_preallocated_musttail(ptr preallocated(i32) %a) 15; CHECK: call void @__tsan_func_exit()16; CHECK-NEXT: %r = musttail call i32 @preallocated_musttail(ptr preallocated(i32) %a)17; CHECK-NEXT: ret i32 %r18 19 20define i32 @call_preallocated_musttail_cast(ptr preallocated(i32) %a) sanitize_thread {21 %r = musttail call i32 @preallocated_musttail(ptr preallocated(i32) %a)22 %t = bitcast i32 %r to i3223 ret i32 %t24}25 26; CHECK-LABEL: define i32 @call_preallocated_musttail_cast(ptr preallocated(i32) %a)27; CHECK: call void @__tsan_func_exit()28; CHECK-NEXT: %r = musttail call i32 @preallocated_musttail(ptr preallocated(i32) %a)29; CHECK-NEXT: %t = bitcast i32 %r to i3230; CHECK-NEXT: ret i32 %t31