Files
swift-mirror/test/IRGen/address_sanitizer_use_odr_indicator.swift
Stefan Gränitz 76243a25db [windows][toolchain] Build sanitizers and builtins standalone for all SDKs (#78861)
Unified builds of compiler-rt together with LLVM failed for the Android SDKs. It got too complicated to redirect the way LLVM would configure the nested build-trees. Standalone builds slightly increase build time, but they turned out much simpler and we end up with less duplication of definitions.
2025-01-28 22:08:07 +01:00

20 lines
789 B
Swift

// XFAIL: OS=windows-msvc
// REQUIRES: asan_runtime
// Default instrumentation that does not use ODR indicators
// and private aliases.
// RUN: %target-swift-frontend -emit-ir -sanitize=address %s | %FileCheck %s
// CHECK: @"[[MANGLED_GLOBAL:.+aGlobal.+]]" =
// CHECK-NOT: __odr_asan_gen_[[MANGLED_GLOBAL]]
// CHECK-NOT: @{{.+}} = private alias {{.*}}@"[[MANGLED_GLOBAL]]"
// Instrumentation with ODR indicators (implies private aliases)
// RUN: %target-swift-frontend -emit-ir -sanitize=address \
// RUN: -sanitize-address-use-odr-indicator %s | \
// RUN: %FileCheck -check-prefix=CHECK-ODR %s
// CHECK-ODR: @"[[MANGLED_GLOBAL:.+aGlobal.+]]" =
// CHECK-ODR: __odr_asan_gen_[[MANGLED_GLOBAL]]
// CHECK-ODR: @{{.+}} = private alias {{.*}}@"[[MANGLED_GLOBAL]]"
let aGlobal:Int = 128;