Files
swift-mirror/test/Interop/Cxx/static/static-local-var.swift
zoecarver 839839f924 [cxx-interop] Rename enable-cxx-interop -> enable-experimental-cxx-interop.
Also removes the driver flag, this will now also always be guarded on `-Xfrontend`.
2022-04-07 19:15:25 -07:00

24 lines
754 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-clangxx -c %S/Inputs/static-local-var.cpp -I %S/Inputs -o %t/static-local-var.o
// RUN: %target-build-swift %s -I %S/Inputs -o %t/statics %t/static-local-var.o -Xfrontend -enable-experimental-cxx-interop
// RUN: %target-codesign %t/statics
// RUN: %target-run %t/statics
//
// REQUIRES: executable_test
import StaticLocalVar
import StdlibUnittest
var StaticLocalVarTestSuite = TestSuite("StaticLocalVarTestSuite")
StaticLocalVarTestSuite.test("static-local-var") {
expectEqual(counter(), 0)
expectEqual(counter(), 1)
// Check that the copies of the `counter()` inline function emitted by Swift
// and Clang share the same static local variable.
expectEqual(counterWrapper(), 2)
}
runAllTests()