Files
swift-mirror/test/Interop/SwiftToCxx/functions/cdecl-execution.cpp
Alex Lorenz 80bc75ab9b [cxx-interop] Emit C++ declarations only when '-clang-header-expose-public-decl' is enabled
This fix also ensures that we only emit C++ functions for now
2022-03-20 20:22:02 -07:00

20 lines
690 B
C++

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %S/cdecl.swift -typecheck -module-name CdeclFunctions -clang-header-expose-public-decls -emit-clang-header-path %t/functions.h
// RUN: %target-interop-build-clangxx -c %s -I %t -o %t/cdecl-execution.o
// RUN: %target-interop-build-swift %S/cdecl.swift -o %t/cdecl-execution -Xlinker %t/cdecl-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain
// RUN: %target-codesign %t/cdecl-execution
// RUN: %target-run %t/cdecl-execution
// REQUIRES: executable_test
#include <cassert>
#include "functions.h"
int main() {
assert(CdeclFunctions::differentCDeclName(1, 1) == 2);
return 0;
}