Files
swift-mirror/test/IRGen/comdat.swift
Saleem Abdulrasool fc164ce098 IRGen: be less aggressive about applying COMDAT
COMDAT can only be applied to definitions, not declarations.  This
manifested in builds of llbuild with SwiftPM on Windows.  The nominal
type descriptor accessor declaration was marked as COMDAT.
2020-08-13 10:42:03 -07:00

15 lines
659 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-ir %S/Inputs/comdat1.swift %S/Inputs/comdat2.swift -O -num-threads 1 -module-name comdat -o %t/comdat1.ll -o %t/comdat2.ll
// RUN: %FileCheck -check-prefix CHECK-1 %s < %t/comdat1.ll
// RUN: %FileCheck -check-prefix CHECK-2 %s < %t/comdat2.ll
// REQUIRES: OS=windows-msvc
// Ensure that the definition is marked as COMDAT
// CHECK-1: "$s6comdat1C33_{{.*}}LLCMa" = comdat any
// CHECK-1: "$s6comdat1C33_{{.*}}LLCMn" = comdat any
// Ensure that no foward declaration is emitted
// CHECK-2-NOT: "$s6comdat1C33_{{.*}}LLCMa" = comdat any
// CHECK-2-NOT: "$s6comdat1C33_{{.*}}LLCMn" = comdat any