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
114 lines
7.9 KiB
C
114 lines
7.9 KiB
C
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-attributes --check-globals all --version 6
|
|
// RUN: %clang_cc1 -O -fexperimental-sanitize-metadata=covered -fexperimental-sanitize-metadata=atomics -fexperimental-sanitize-metadata=uar -triple x86_64-gnu-linux -x c -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK
|
|
|
|
//.
|
|
// CHECK: @__start_sanmd_covered2 = extern_weak hidden global ptr
|
|
// CHECK: @__stop_sanmd_covered2 = extern_weak hidden global ptr
|
|
// CHECK: @__start_sanmd_atomics2 = extern_weak hidden global ptr
|
|
// CHECK: @__stop_sanmd_atomics2 = extern_weak hidden global ptr
|
|
// CHECK: @llvm.used = appending global [4 x ptr] [ptr @__sanitizer_metadata_covered2.module_ctor, ptr @__sanitizer_metadata_covered2.module_dtor, ptr @__sanitizer_metadata_atomics2.module_ctor, ptr @__sanitizer_metadata_atomics2.module_dtor], section "llvm.metadata"
|
|
// CHECK: @llvm.global_ctors = appending global [2 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 2, ptr @__sanitizer_metadata_covered2.module_ctor, ptr @__sanitizer_metadata_covered2.module_ctor }, { i32, ptr, ptr } { i32 2, ptr @__sanitizer_metadata_atomics2.module_ctor, ptr @__sanitizer_metadata_atomics2.module_ctor }]
|
|
// CHECK: @llvm.global_dtors = appending global [2 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 2, ptr @__sanitizer_metadata_covered2.module_dtor, ptr @__sanitizer_metadata_covered2.module_dtor }, { i32, ptr, ptr } { i32 2, ptr @__sanitizer_metadata_atomics2.module_dtor, ptr @__sanitizer_metadata_atomics2.module_dtor }]
|
|
//.
|
|
// CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
|
|
// CHECK-LABEL: define dso_local void @escape(
|
|
// CHECK-SAME: ptr noundef [[P:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] !pcsections [[META5:![0-9]+]] {
|
|
// CHECK-NEXT: [[ENTRY:.*:]]
|
|
// CHECK-NEXT: ret void
|
|
//
|
|
__attribute__((noinline, not_tail_called)) void escape(const volatile void *p) {
|
|
static const volatile void *sink;
|
|
sink = p;
|
|
}
|
|
|
|
// CHECK: Function Attrs: mustprogress norecurse nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none)
|
|
// CHECK-LABEL: define dso_local i32 @normal_function(
|
|
// CHECK-SAME: ptr noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] !pcsections [[META7:![0-9]+]] {
|
|
// CHECK-NEXT: [[ENTRY:.*:]]
|
|
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca ptr, align 8
|
|
// CHECK-NEXT: store ptr [[X]], ptr [[X_ADDR]], align 8, !tbaa [[INTPTR_TBAA9:![0-9]+]]
|
|
// CHECK-NEXT: store atomic i32 1, ptr [[X]] monotonic, align 4, !pcsections [[META12:![0-9]+]]
|
|
// CHECK-NEXT: notail call void @escape(ptr noundef nonnull [[X_ADDR]])
|
|
// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[Y]], align 4, !tbaa [[INT_TBAA1:![0-9]+]]
|
|
// CHECK-NEXT: ret i32 [[TMP0]]
|
|
//
|
|
int normal_function(int *x, int *y) {
|
|
__atomic_store_n(x, 1, __ATOMIC_RELAXED);
|
|
escape(&x);
|
|
return *y;
|
|
}
|
|
|
|
// CHECK: Function Attrs: disable_sanitizer_instrumentation mustprogress norecurse nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none)
|
|
// CHECK-LABEL: define dso_local i32 @test_disable_sanitize_instrumentation(
|
|
// CHECK-SAME: ptr noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
|
|
// CHECK-NEXT: [[ENTRY:.*:]]
|
|
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca ptr, align 8
|
|
// CHECK-NEXT: store ptr [[X]], ptr [[X_ADDR]], align 8, !tbaa [[INTPTR_TBAA9]]
|
|
// CHECK-NEXT: store atomic i32 1, ptr [[X]] monotonic, align 4
|
|
// CHECK-NEXT: notail call void @escape(ptr noundef nonnull [[X_ADDR]])
|
|
// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[Y]], align 4, !tbaa [[INT_TBAA1]]
|
|
// CHECK-NEXT: ret i32 [[TMP0]]
|
|
//
|
|
__attribute__((disable_sanitizer_instrumentation)) int test_disable_sanitize_instrumentation(int *x, int *y) {
|
|
__atomic_store_n(x, 1, __ATOMIC_RELAXED);
|
|
escape(&x);
|
|
return *y;
|
|
}
|
|
|
|
// CHECK: Function Attrs: mustprogress norecurse nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none)
|
|
// CHECK-LABEL: define dso_local i32 @test_no_sanitize_thread(
|
|
// CHECK-SAME: ptr noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR3:[0-9]+]] !pcsections [[META13:![0-9]+]] {
|
|
// CHECK-NEXT: [[ENTRY:.*:]]
|
|
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca ptr, align 8
|
|
// CHECK-NEXT: store ptr [[X]], ptr [[X_ADDR]], align 8, !tbaa [[INTPTR_TBAA9]]
|
|
// CHECK-NEXT: store atomic i32 1, ptr [[X]] monotonic, align 4, !pcsections [[META12]]
|
|
// CHECK-NEXT: notail call void @escape(ptr noundef nonnull [[X_ADDR]])
|
|
// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[Y]], align 4, !tbaa [[INT_TBAA1]]
|
|
// CHECK-NEXT: ret i32 [[TMP0]]
|
|
//
|
|
__attribute__((no_sanitize("thread"))) int test_no_sanitize_thread(int *x, int *y) {
|
|
__atomic_store_n(x, 1, __ATOMIC_RELAXED);
|
|
escape(&x);
|
|
return *y;
|
|
}
|
|
|
|
// CHECK: Function Attrs: mustprogress norecurse nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none)
|
|
// CHECK-LABEL: define dso_local i32 @test_no_sanitize_all(
|
|
// CHECK-SAME: ptr noundef [[X:%.*]], ptr noundef readonly captures(none) [[Y:%.*]]) local_unnamed_addr #[[ATTR3]] !pcsections [[META13]] {
|
|
// CHECK-NEXT: [[ENTRY:.*:]]
|
|
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca ptr, align 8
|
|
// CHECK-NEXT: store ptr [[X]], ptr [[X_ADDR]], align 8, !tbaa [[INTPTR_TBAA9]]
|
|
// CHECK-NEXT: store atomic i32 1, ptr [[X]] monotonic, align 4, !pcsections [[META12]]
|
|
// CHECK-NEXT: notail call void @escape(ptr noundef nonnull [[X_ADDR]])
|
|
// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[Y]], align 4, !tbaa [[INT_TBAA1]]
|
|
// CHECK-NEXT: ret i32 [[TMP0]]
|
|
//
|
|
__attribute__((no_sanitize("all"))) int test_no_sanitize_all(int *x, int *y) {
|
|
__atomic_store_n(x, 1, __ATOMIC_RELAXED);
|
|
escape(&x);
|
|
return *y;
|
|
}
|
|
//.
|
|
// CHECK: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
|
|
// CHECK: attributes #[[ATTR1]] = { mustprogress norecurse nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
|
|
// CHECK: attributes #[[ATTR2]] = { disable_sanitizer_instrumentation mustprogress norecurse nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
|
|
// CHECK: attributes #[[ATTR3]] = { mustprogress norecurse nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none, target_mem: none) "min-legal-vector-width"="0" "no-trapping-math"="true" "no_sanitize_thread" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
|
|
// CHECK: attributes #[[ATTR4:[0-9]+]] = { nounwind "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
|
|
//.
|
|
// CHECK: [[META0:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
|
|
// CHECK: [[INT_TBAA1]] = !{[[META2:![0-9]+]], [[META2]], i64 0}
|
|
// CHECK: [[META2]] = !{!"int", [[META3:![0-9]+]], i64 0}
|
|
// CHECK: [[META3]] = !{!"omnipotent char", [[META4:![0-9]+]], i64 0}
|
|
// CHECK: [[META4]] = !{!"Simple C/C++ TBAA"}
|
|
// CHECK: [[META5]] = !{!"sanmd_covered2!C", [[META6:![0-9]+]]}
|
|
// CHECK: [[META6]] = !{i64 0}
|
|
// CHECK: [[META7]] = !{!"sanmd_covered2!C", [[META8:![0-9]+]]}
|
|
// CHECK: [[META8]] = !{i64 3}
|
|
// CHECK: [[INTPTR_TBAA9]] = !{[[META10:![0-9]+]], [[META10]], i64 0}
|
|
// CHECK: [[META10]] = !{!"p1 int", [[META11:![0-9]+]], i64 0}
|
|
// CHECK: [[META11]] = !{!"any pointer", [[META3]], i64 0}
|
|
// CHECK: [[META12]] = !{!"sanmd_atomics2!C"}
|
|
// CHECK: [[META13]] = !{!"sanmd_covered2!C", [[META14:![0-9]+]]}
|
|
// CHECK: [[META14]] = !{i64 2}
|
|
//.
|