Files
TheRock/compiler/amd-llvm/llvm/test/Instrumentation/SanitizerCoverage/coff-comdat.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

86 lines
2.8 KiB
LLVM

; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=1 -sanitizer-coverage-inline-8bit-counters=1 -sanitizer-coverage-pc-table=1 -S | FileCheck %s
; Make sure we use the right comdat groups for COFF to avoid relocations
; against discarded sections. Internal linkage functions are also different from
; ELF. We don't add a module unique identifier.
; Test based on this source:
; int baz(int);
; static int __attribute__((noinline)) bar(int x) {
; if (x)
; return baz(x);
; return 0;
; }
; int foo(int x) {
; if (baz(0))
; x = bar(x);
; return x;
; }
; Both new comdats should no duplicates on COFF.
; CHECK: $foo = comdat nodeduplicate
; CHECK: $bar = comdat nodeduplicate
; Tables for 'foo' should be in the 'foo' comdat.
; CHECK: @__sancov_gen_{{.*}} = private global [1 x i8] zeroinitializer, section ".SCOV$CM", comdat($foo), align 1
; CHECK: @__sancov_gen_{{.*}} = private constant [2 x ptr]
; CHECK-SAME: [ptr @foo, ptr inttoptr (i64 1 to ptr)],
; CHECK-SAME: section ".SCOVP$M", comdat($foo), align 8
; Tables for 'bar' should be in the 'bar' comdat.
; CHECK: @__sancov_gen_{{.*}} = private global [1 x i8] zeroinitializer, section ".SCOV$CM", comdat($bar), align 1
; CHECK: @__sancov_gen_{{.*}} = private constant [2 x ptr]
; CHECK-SAME: [ptr @bar, ptr inttoptr (i64 1 to ptr)],
; CHECK-SAME: section ".SCOVP$M", comdat($bar), align 8
; 'foo' and 'bar' should be in their new comdat groups.
; CHECK: define dso_local i32 @foo(i32 %x){{.*}} comdat {
; CHECK: define internal fastcc i32 @bar(i32 %x){{.*}} comdat {
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.14.26433"
; Function Attrs: nounwind uwtable
define dso_local i32 @foo(i32 %x) local_unnamed_addr #0 {
entry:
%call = tail call i32 @baz(i32 0) #3
%tobool = icmp eq i32 %call, 0
br i1 %tobool, label %if.end, label %if.then
if.then: ; preds = %entry
%call1 = tail call fastcc i32 @bar(i32 %x)
br label %if.end
if.end: ; preds = %entry, %if.then
%x.addr.0 = phi i32 [ %call1, %if.then ], [ %x, %entry ]
ret i32 %x.addr.0
}
declare dso_local i32 @baz(i32) local_unnamed_addr #1
; Function Attrs: noinline nounwind uwtable
define internal fastcc i32 @bar(i32 %x) unnamed_addr #2 {
entry:
%tobool = icmp eq i32 %x, 0
br i1 %tobool, label %return, label %if.then
if.then: ; preds = %entry
%call = tail call i32 @baz(i32 %x) #3
br label %return
return: ; preds = %entry, %if.then
%retval.0 = phi i32 [ %call, %if.then ], [ 0, %entry ]
ret i32 %retval.0
}
attributes #0 = { nounwind uwtable }
attributes #1 = { "asdf" }
attributes #2 = { noinline nounwind uwtable }
attributes #3 = { nounwind }