Files
TheRock/compiler/amd-llvm/llvm/test/Instrumentation/ThreadSanitizer/eh.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

77 lines
2.9 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt < %s -passes=tsan -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-EXC
; RUN: opt < %s -passes=tsan -S -tsan-handle-cxx-exceptions=0 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOEXC
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
declare void @can_throw()
declare void @cannot_throw() nounwind
define i32 @func1() sanitize_thread {
; CHECK-EXC-LABEL: define i32 @func1
; CHECK-EXC-SAME: () #[[ATTR1:[0-9]+]] personality ptr @__gcc_personality_v0 {
; CHECK-EXC-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress.p0(i32 0)
; CHECK-EXC-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
; CHECK-EXC-NEXT: invoke void @can_throw()
; CHECK-EXC-NEXT: to label [[DOTNOEXC:%.*]] unwind label [[TSAN_CLEANUP:%.*]]
; CHECK-EXC: .noexc:
; CHECK-EXC-NEXT: call void @__tsan_func_exit()
; CHECK-EXC-NEXT: ret i32 0
; CHECK-EXC: tsan_cleanup:
; CHECK-EXC-NEXT: [[CLEANUP_LPAD:%.*]] = landingpad { ptr, i32 }
; CHECK-EXC-NEXT: cleanup
; CHECK-EXC-NEXT: call void @__tsan_func_exit()
; CHECK-EXC-NEXT: resume { ptr, i32 } [[CLEANUP_LPAD]]
;
; CHECK-NOEXC-LABEL: define i32 @func1
; CHECK-NOEXC-SAME: () #[[ATTR1:[0-9]+]] {
; CHECK-NOEXC-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress.p0(i32 0)
; CHECK-NOEXC-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
; CHECK-NOEXC-NEXT: call void @can_throw()
; CHECK-NOEXC-NEXT: call void @__tsan_func_exit()
; CHECK-NOEXC-NEXT: ret i32 0
;
call void @can_throw()
ret i32 0
}
define i32 @func2() sanitize_thread {
; CHECK-LABEL: define i32 @func2
; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress.p0(i32 0)
; CHECK-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
; CHECK-NEXT: call void @cannot_throw()
; CHECK-NEXT: call void @__tsan_func_exit()
; CHECK-NEXT: ret i32 0
;
call void @cannot_throw()
ret i32 0
}
define i32 @func3(ptr %p) sanitize_thread {
; CHECK-LABEL: define i32 @func3
; CHECK-SAME: (ptr [[P:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress.p0(i32 0)
; CHECK-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
; CHECK-NEXT: call void @__tsan_read4(ptr [[P]])
; CHECK-NEXT: [[A:%.*]] = load i32, ptr [[P]], align 4
; CHECK-NEXT: call void @__tsan_func_exit()
; CHECK-NEXT: ret i32 [[A]]
;
%a = load i32, ptr %p
ret i32 %a
}
define i32 @func4() sanitize_thread nounwind {
; CHECK-LABEL: define i32 @func4
; CHECK-SAME: () #[[ATTR2:[0-9]+]] {
; CHECK-NEXT: [[TMP1:%.*]] = call ptr @llvm.returnaddress.p0(i32 0)
; CHECK-NEXT: call void @__tsan_func_entry(ptr [[TMP1]])
; CHECK-NEXT: call void @can_throw()
; CHECK-NEXT: call void @__tsan_func_exit()
; CHECK-NEXT: ret i32 0
;
call void @can_throw()
ret i32 0
}