Files
TheRock/compiler/amd-llvm/compiler-rt/test/tysan/ignorelist.c
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

36 lines
1.4 KiB
C

// RUN: %clang_tysan %s -o %t && %run %t 10 >%t.out.0 2>&1
// RUN: FileCheck --check-prefixes=CHECK,CHECK-BOTH %s < %t.out.0
// RUN: echo "fun:typeViolationignored" > %tmp
// RUN: echo "src:*ignorelist.h" > %tmp
// RUN: %clang_tysan -fsanitize-ignorelist=%tmp %s -o %t && %run %t 10 >%t.out 2>&1
// RUN: FileCheck --check-prefixes=CHECK-IGNORELIST,CHECK-BOTH %s < %t.out
#include "ignorelist.h"
#include <stdio.h>
#include <stdlib.h>
void typeViolationIgnored(float *fPtr) { printf("As int: %d\n", *(int *)fPtr); }
void typeViolation(int *fPtr) { printf("As float: %f\n", *(float *)fPtr); }
int main() {
float *f = (float *)malloc(sizeof(float));
*f = 413.0f;
typeViolationIgnored(f);
// CHECK: TypeSanitizer: type-aliasing-violation on address 0x{{.*}}
// CHECK-NEXT: READ of size 4 at 0x{{.*}} with type int accesses an existing object of type float
// CHECK-IGNORELIST-NOT: TypeSanitizer: type-aliasing-violation on address 0x{{.*}}
int *i = (int *)malloc(sizeof(int));
*i = 612;
typeViolation(i);
// CHECK-BOTH: TypeSanitizer: type-aliasing-violation on address 0x{{.*}}
// CHECK-BOTH: READ of size 4 at 0x{{.*}} with type float accesses an existing object of type int
typeViolationMultiFile((void *)i);
// CHECK: TypeSanitizer: type-aliasing-violation on address 0x{{.*}}
// CHECK-IGNORELIST-NOT: TypeSanitizer: type-aliasing-violation on address 0x{{.*}}
return 0;
}