|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: mkdir -p %t/resources/linux/armv7 %t/sdk/usr/include %t/sdk/usr/lib/swift/linux/armv7 |
| 3 | +// RUN: touch %t/sdk/usr/include/{inttypes,stdint,unistd}.h |
| 4 | + |
| 5 | +// RUN: touch %t/resources/linux/armv7/{SwiftGlibc.h,glibc.modulemap} |
| 6 | +// RUN: touch %t/sdk/usr/lib/swift/linux/armv7/{SwiftGlibc.h,glibc.modulemap} |
| 7 | +// RUN: %swift %s -typecheck -parse-stdlib -dump-clang-diagnostics -target armv7-unknown-linux-gnueabihf -sdk %t/sdk -resource-dir %t/resources 2>&1 | %FileCheck -check-prefix=CHECK-LINUX %s |
| 8 | + |
| 9 | +// RUN: cp %S/../../stdlib/public/Cxx/{cxxshim/libcxxshim.modulemap,libstdcxx/libstdcxx.h,libstdcxx/libstdcxx.modulemap} %t/resources/linux |
| 10 | +// RUN: %target-swift-frontend %s -typecheck -parse-stdlib -dump-clang-diagnostics -resource-dir %t/resources -cxx-interoperability-mode=default 2>&1 | %FileCheck -check-prefix=CHECK-CXX -check-prefix=CHECK-%target-os-CXX %s |
| 11 | + |
| 12 | +// RUN: mkdir -p %t/resources/android/aarch64 %t/sdk/usr/lib/swift/android/aarch64 |
| 13 | +// RUN: cp %S/../../stdlib/public/Platform/{SwiftAndroidNDK.h,SwiftBionic.h,android.modulemap} %t/resources/android/aarch64 |
| 14 | +// RUN: cp %S/../../stdlib/public/Platform/{SwiftAndroidNDK.h,SwiftBionic.h,android.modulemap} %t/sdk/usr/lib/swift/android/aarch64 |
| 15 | +// RUN: %swift %s -typecheck -parse-stdlib -dump-clang-diagnostics -target aarch64-unknown-linux-android -sdk %t/sdk -resource-dir %t/resources 2>&1 | %FileCheck -check-prefix=CHECK-ANDROID %s |
| 16 | + |
| 17 | +// RUN: cp %S/../../stdlib/public/Cxx/cxxshim/libcxxshim.modulemap %t/resources/android |
| 18 | +// RUN: cp %S/../../stdlib/public/Cxx/cxxshim/libcxxshim.modulemap %t/sdk/usr/lib/swift/android |
| 19 | +// RUN: %swift %s -typecheck -parse-stdlib -dump-clang-diagnostics -target aarch64-unknown-linux-android -sdk %t/sdk -resource-dir %t/resources -cxx-interoperability-mode=default 2>&1 | %FileCheck -check-prefix=CHECK-ANDROID-CXX %s |
| 20 | + |
| 21 | +// CHECK-LINUX: clang importer redirected file mappings: |
| 22 | +// CHECK-LINUX-NEXT: mapping real file '{{.*}}{{/|\\}}resources{{/|\\}}linux{{/|\\}}armv7{{/|\\}}glibc.modulemap' to virtual file '{{.*}}{{/|\\}}sdk{{/|\\}}usr{{/|\\}}include{{/|\\}}module.modulemap' |
| 23 | +// CHECK-LINUX-NEXT: mapping real file '{{.*}}{{/|\\}}resources{{/|\\}}linux{{/|\\}}armv7{{/|\\}}SwiftGlibc.h' to virtual file '{{.*}}{{/|\\}}sdk{{/|\\}}usr{{/|\\}}include{{/|\\}}SwiftGlibc.h' |
| 24 | + |
| 25 | +// CHECK-CXX: clang importer redirected file mappings: |
| 26 | +// CHECK-linux-gnu-CXX: mapping real file '{{.*}}/resources/linux/libstdcxx.h' to virtual file '{{.*}}/usr/include/c++/{{.*}}/libstdcxx.h' |
| 27 | +// CHECK-linux-gnu-CXX: clang importer overriding file '{{.*}}/usr/include/c++/{{.*}}/module.modulemap' with the following contents: |
| 28 | +// CHECK-linux-gnu-CXX-NEXT: --- libstdcxx.modulemap --- |
| 29 | +// CHECK-linux-gnu-CXX: Currently libstdc++ does not have a module map. To work around |
| 30 | +// CHECK-linux-gnu-CXX-NEXT: this, Swift provides its own module map for libstdc++. |
| 31 | +// CHECK-linux-gnu-CXX: header "libstdcxx.h" |
| 32 | +// CHECK-linux-gnu-CXX: clang importer driver args: {{.*}}'-fmodule-map-file={{.*}}resources/linux/libcxxshim.modulemap' |
| 33 | + |
| 34 | +// CHECK-ANDROID: clang importer redirected file mappings: |
| 35 | +// CHECK-ANDROID-NEXT: mapping real file '{{.*}}{{/|\\}}resources{{/|\\}}android{{/|\\}}aarch64{{/|\\}}android.modulemap' to virtual file '{{.*}}{{/|\\}}sdk{{/|\\}}usr{{/|\\}}include{{/|\\}}module.modulemap' |
| 36 | +// CHECK-ANDROID-NEXT: mapping real file '{{.*}}{{/|\\}}resources{{/|\\}}android{{/|\\}}aarch64{{/|\\}}SwiftAndroidNDK.h' to virtual file '{{.*}}{{/|\\}}sdk{{/|\\}}usr{{/|\\}}include{{/|\\}}SwiftAndroidNDK.h' |
| 37 | +// CHECK-ANDROID-NEXT: mapping real file '{{.*}}{{/|\\}}resources{{/|\\}}android{{/|\\}}aarch64{{/|\\}}SwiftBionic.h' to virtual file '{{.*}}{{/|\\}}sdk{{/|\\}}usr{{/|\\}}include{{/|\\}}SwiftBionic.h' |
| 38 | + |
| 39 | +// CHECK-ANDROID-CXX: clang importer driver args: {{.*}}'-fmodule-map-file={{.*}}resources{{/|\\}}android{{/|\\}}libcxxshim.modulemap' |
0 commit comments