[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / Instrumentation / ThreadSanitizer / tsan_musttail.ll
blobbb681f67e0ecdb0a64e535fad746a9e7c4fdadd3
1 ; To test that __tsan_func_exit always happen before musttaill call and no exception handling code.
2 ; RUN: opt < %s -tsan -S | FileCheck %s
4 define internal i32 @preallocated_musttail(i32* preallocated(i32) %p) sanitize_thread {
5   %rv = load i32, i32* %p
6   ret i32 %rv
9 define i32 @call_preallocated_musttail(i32* preallocated(i32) %a) sanitize_thread {
10   %r = musttail call i32 @preallocated_musttail(i32* preallocated(i32) %a)
11   ret i32 %r
14 ; CHECK-LABEL:  define i32 @call_preallocated_musttail(i32* preallocated(i32) %a) 
15 ; CHECK:          call void @__tsan_func_exit()
16 ; CHECK-NEXT:     %r = musttail call i32 @preallocated_musttail(i32* preallocated(i32) %a)
17 ; CHECK-NEXT:     ret i32 %r
20 define i32 @call_preallocated_musttail_cast(i32* preallocated(i32) %a) sanitize_thread {
21   %r = musttail call i32 @preallocated_musttail(i32* preallocated(i32) %a)
22   %t = bitcast i32 %r to i32
23   ret i32 %t
26 ; CHECK-LABEL:  define i32 @call_preallocated_musttail_cast(i32* preallocated(i32) %a)
27 ; CHECK:          call void @__tsan_func_exit()
28 ; CHECK-NEXT:     %r = musttail call i32 @preallocated_musttail(i32* preallocated(i32) %a)
29 ; CHECK-NEXT:     %t = bitcast i32 %r to i32
30 ; CHECK-NEXT:     ret i32 %t