File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed
stdlib/public/SwiftShims/swift/shims Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -513,6 +513,10 @@ void importer::getNormalInvocationArguments(
513513 " -isystem" , searchPathOpts.RuntimeResourcePath ,
514514 });
515515
516+ if (LangOpts.hasFeature (Feature::Embedded)) {
517+ invocationArgStrs.insert (invocationArgStrs.end (), {" -D__swift_embedded__" });
518+ }
519+
516520 // Enable Position Independence. `-fPIC` is not supported on Windows, which
517521 // is implicitly position independent.
518522 if (!triple.isOSWindows ())
Original file line number Diff line number Diff line change 2424
2525// Clang has been defining __INTxx_TYPE__ macros for a long time.
2626// __UINTxx_TYPE__ are defined only since Clang 3.5.
27- #if !defined(__APPLE__) && !defined(__linux__) && !defined(__OpenBSD__) && !defined(__wasi__)
27+ #if !defined(__APPLE__) && !defined(__linux__) && !defined(__OpenBSD__) && !defined(__wasi__) && !defined(__swift_embedded__)
2828#include < stdint.h>
2929typedef int64_t __swift_int64_t ;
3030typedef uint64_t __swift_uint64_t ;
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: mkdir -p %t/include
3+ // RUN: %{python} %utils/split_file.py -o %t %s
4+
5+ // RUN: %target-swift-frontend -target armv7em-none-none-eabi -emit-ir %t/Main.swift -enable-experimental-feature Embedded -module-cache-path %t/ModuleCache -Xcc -I%t/include
6+
7+ // REQUIRES: swift_in_compiler
8+ // REQUIRES: optimized_stdlib
9+ // REQUIRES: CODEGENERATOR=ARM
10+ // REQUIRES: embedded_stdlib_cross_compiling
11+ // REQUIRES: swift_feature_Embedded
12+
13+ // BEGIN Main.swift
14+
15+ print ( " hello " )
16+
17+ // BEGIN include/stdint.h
18+
19+ #include < float. h>
20+ typedef __INTPTR_TYPE__ intptr_t;
21+ typedef __UINTPTR_TYPE__ uintptr_t;
22+ typedef __INT64 _TYPE__ int64 _t;
23+ typedef __UINT64 _TYPE__ uint64 _t;
24+ typedef __INT32 _TYPE__ int32 _t;
25+ typedef __UINT32 _TYPE__ uint32 _t;
26+ typedef __INT16 _TYPE__ int16 _t;
27+ typedef __UINT16 _TYPE__ uint16 _t;
28+ typedef __INT8 _TYPE__ int8 _t;
29+ typedef __UINT8 _TYPE__ uint8 _t;
You can’t perform that action at this time.
0 commit comments