Files
swift-mirror/test/Interop/SwiftToCxx/class/swift-class-static-variables-execution.cpp
Gabor Horvath fe1a4b5961 [cxx-interop] Export accessors of static properties to C++
The code wants to avoid exporting certain synthesized operators but it
inadvertently also prevented exporting accessors to static properties.

rdar://115564118
2024-07-12 16:33:35 +01:00

23 lines
796 B
C++

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %S/swift-class-static-variables.swift -typecheck -module-name Class -clang-header-expose-decls=all-public -emit-clang-header-path %t/class.h
// RUN: %target-interop-build-clangxx -c %s -I %t -o %t/swift-class-execution.o
// RUN: %target-interop-build-swift %S/swift-class-static-variables.swift -o %t/swift-class-execution -Xlinker %t/swift-class-execution.o -module-name Class -Xfrontend -entry-point-function-name -Xfrontend swiftMain
// RUN: %target-codesign %t/swift-class-execution
// RUN: %target-run %t/swift-class-execution
// REQUIRES: executable_test
#include "class.h"
#include <assert.h>
#include <cstdio>
using namespace Class;
int main() {
auto x = FileUtilities::getShared();
assert(x.getField() == 42);
}