File tree 3 files changed +43
-0
lines changed
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 24
24
#include <math.h>
25
25
#include <setjmp.h>
26
26
#include <signal.h>
27
+ #ifdef __cplusplus
28
+ // The Android r26 NDK contains an old libc++ modulemap that requires C++23
29
+ // for 'stdatomic', which can't be imported unless we're using C++23. Thus,
30
+ // import stdatomic from the NDK directly, bypassing the stdatomic from the libc++.
31
+ #pragma clang module import _stdatomic
32
+ #else
27
33
#include <stdatomic.h>
34
+ #endif
28
35
#include <stdint.h>
29
36
#include <stdio.h>
30
37
#include <stdio_ext.h>
Original file line number Diff line number Diff line change 24
24
#include <math.h>
25
25
#include <setjmp.h>
26
26
#include <signal.h>
27
+ #ifdef __cplusplus
28
+ // The Android r26 NDK contains an old libc++ modulemap that requires C++23
29
+ // for 'stdatomic', which can't be imported unless we're using C++23. Thus,
30
+ // import stdatomic from the NDK directly, bypassing the stdatomic from the libc++.
31
+ #pragma clang module import _stdatomic
32
+ #else
27
33
#include <stdatomic.h>
34
+ #endif
28
35
#include <stdint.h>
29
36
#include <stdio.h>
30
37
#include <stdio_ext.h>
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend %s -c -cxx-interoperability-mode=default -Xcc -std=c++14 -Xcc -fmodules-cache-path=%t
3
+ // RUN: %target-swift-frontend %s -c -cxx-interoperability-mode=default -Xcc -std=c++17 -Xcc -fmodules-cache-path=%t
4
+ // RUN: %target-swift-frontend %s -c -cxx-interoperability-mode=default -Xcc -std=c++20 -Xcc -fmodules-cache-path=%t
5
+
6
+ // RUN: find %t | %FileCheck %s
7
+
8
+ // RUN: %empty-directory(%t)
9
+
10
+ // RUN: %target-swift-frontend %s -c -cxx-interoperability-mode=default -Xcc -std=c++17 -Xcc -fmodules-cache-path=%t -DADD_CXXSTDLIB
11
+ // RUN: %target-swift-frontend %s -c -cxx-interoperability-mode=default -Xcc -std=c++20 -Xcc -fmodules-cache-path=%t -DADD_CXXSTDLIB
12
+
13
+ // REQUIRES: OS=linux-android
14
+
15
+ import Android
16
+ import Bionic
17
+
18
+ #if ADD_CXXSTDLIB
19
+ import CxxStdlib
20
+ #endif
21
+
22
+ func test( ) {
23
+ #if ADD_CXXSTDLIB
24
+ let _ = std. string ( )
25
+ #endif
26
+ }
27
+
28
+ // CHECK-DAG: Android{{.*}}.pcm
29
+ // CHECK-DAG: std{{.*}}.pcm
You can’t perform that action at this time.
0 commit comments