| 1 |
// A basic clang -cc1 command-line. WebAssembly is somewhat special in |
| 2 |
// enabling -fvisibility=hidden by default. |
| 3 |
|
| 4 |
// RUN: %clangxx -### %s --target=wasm32-unknown-unknown 2>&1 \ |
| 5 |
// RUN: | FileCheck -check-prefix=CC1 %s |
| 6 |
// CC1: "-cc1" "-triple" "wasm32-unknown-unknown" {{.*}} "-fvisibility=hidden" {{.*}} |
| 7 |
|
| 8 |
// Ditto, but ensure that a user -fvisibility=default disables the default |
| 9 |
// -fvisibility=hidden. |
| 10 |
|
| 11 |
// RUN: %clangxx -### %s --target=wasm32-unknown-unknown -fvisibility=default 2>&1 \ |
| 12 |
// RUN: | FileCheck -check-prefix=FVISIBILITY_DEFAULT %s |
| 13 |
// FVISIBILITY_DEFAULT-NOT: hidden |
| 14 |
|
| 15 |
// A basic C++ link command-line with unknown OS. |
| 16 |
|
| 17 |
// RUN: %clangxx -### --target=wasm32-unknown-unknown --sysroot=/foo --stdlib=libc++ %s 2>&1 \ |
| 18 |
// RUN: | FileCheck -check-prefix=LINK %s |
| 19 |
// LINK: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 20 |
// LINK: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins.a" "-o" "a.out" |
| 21 |
|
| 22 |
// RUN: %clangxx -### --target=wasm32-unknown-unknown --sysroot=/foo --stdlib=libstdc++ %s 2>&1 \ |
| 23 |
// RUN: | FileCheck -check-prefix=LINK_STDCXX %s |
| 24 |
// LINK_STDCXX: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 25 |
// LINK_STDCXX: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lstdc++" "-lc" "{{.*[/\\]}}libclang_rt.builtins.a" "-o" "a.out" |
| 26 |
|
| 27 |
// A basic C++ link command-line with optimization with unknown OS. |
| 28 |
|
| 29 |
// RUN: %clangxx -### -O2 --target=wasm32-unknown-unknown --sysroot=/foo %s --stdlib=libc++ 2>&1 \ |
| 30 |
// RUN: | FileCheck -check-prefix=LINK_OPT %s |
| 31 |
// LINK_OPT: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 32 |
// LINK_OPT: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins.a" "-o" "a.out" |
| 33 |
|
| 34 |
// RUN: %clangxx -### -O2 --target=wasm32-unknown-unknown --sysroot=/foo %s --stdlib=libstdc++ 2>&1 \ |
| 35 |
// RUN: | FileCheck -check-prefix=LINK_OPT_STDCXX %s |
| 36 |
// LINK_OPT_STDCXX: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 37 |
// LINK_OPT_STDCXX: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lstdc++" "-lc" "{{.*[/\\]}}libclang_rt.builtins.a" "-o" "a.out" |
| 38 |
|
| 39 |
// A basic C++ link command-line with known OS. |
| 40 |
|
| 41 |
// RUN: %clangxx -### --target=wasm32-wasi --sysroot=/foo --stdlib=libc++ %s 2>&1 \ |
| 42 |
// RUN: | FileCheck -check-prefix=LINK_KNOWN %s |
| 43 |
// LINK_KNOWN: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 44 |
// LINK_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins.a" "-o" "a.out" |
| 45 |
|
| 46 |
// RUN: %clangxx -### --target=wasm32-wasi --sysroot=/foo --stdlib=libstdc++ %s 2>&1 \ |
| 47 |
// RUN: | FileCheck -check-prefix=LINK_KNOWN_STDCXX %s |
| 48 |
// LINK_KNOWN_STDCXX: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 49 |
// LINK_KNOWN_STDCXX: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi" "crt1.o" "[[temp]]" "-lstdc++" "-lc" "{{.*[/\\]}}libclang_rt.builtins.a" "-o" "a.out" |
| 50 |
|
| 51 |
// A basic C++ link command-line with optimization with known OS. |
| 52 |
|
| 53 |
// RUN: %clangxx -### -O2 --target=wasm32-wasi --sysroot=/foo %s --stdlib=libc++ 2>&1 \ |
| 54 |
// RUN: | FileCheck -check-prefix=LINK_OPT_KNOWN %s |
| 55 |
// LINK_OPT_KNOWN: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 56 |
// LINK_OPT_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins.a" "-o" "a.out" |
| 57 |
|
| 58 |
// RUN: %clangxx -### -O2 --target=wasm32-wasi --sysroot=/foo %s --stdlib=libstdc++ 2>&1 \ |
| 59 |
// RUN: | FileCheck -check-prefix=LINK_OPT_KNOWN_STDCXX %s |
| 60 |
// LINK_OPT_KNOWN_STDCXX: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 61 |
// LINK_OPT_KNOWN_STDCXX: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi" "crt1.o" "[[temp]]" "-lstdc++" "-lc" "{{.*[/\\]}}libclang_rt.builtins.a" "-o" "a.out" |
| 62 |
|
| 63 |
// A basic C++ compile command-line with known OS. |
| 64 |
|
| 65 |
// RUN: %clangxx -### --target=wasm32-wasi --stdlib=libc++ %s 2>&1 \ |
| 66 |
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree/usr \ |
| 67 |
// RUN: | FileCheck -check-prefix=COMPILE %s |
| 68 |
// COMPILE: "-cc1" |
| 69 |
// COMPILE: "-resource-dir" "[[RESOURCE_DIR:[^"]*]]" |
| 70 |
// COMPILE: "-isysroot" "[[SYSROOT:[^"]+]]" |
| 71 |
// COMPILE: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/wasm32-wasi/c++/v1" |
| 72 |
// COMPILE: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/v1" |
| 73 |
// COMPILE: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" |
| 74 |
// COMPILE: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/wasm32-wasi" |
| 75 |
// COMPILE: "-internal-isystem" "[[SYSROOT:[^"]+]]/include" |
| 76 |
|
| 77 |
// RUN: %clangxx -### --target=wasm32-wasi --stdlib=libstdc++ %s 2>&1 \ |
| 78 |
// RUN: --sysroot=%S/Inputs/basic_linux_libstdcxx_libcxxv2_tree/usr \ |
| 79 |
// RUN: | FileCheck -check-prefix=COMPILE_STDCXX %s |
| 80 |
// COMPILE_STDCXX: "-cc1" |
| 81 |
// COMPILE_STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]*]]" |
| 82 |
// COMPILE_STDCXX: "-isysroot" "[[SYSROOT:[^"]+]]" |
| 83 |
// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/4.8/wasm32-wasi" |
| 84 |
// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/4.8" |
| 85 |
// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/4.8/backward" |
| 86 |
// COMPILE_STDCXX: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" |
| 87 |
// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/wasm32-wasi" |
| 88 |
// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include" |
| 89 |
|
| 90 |
// RUN: %clangxx -### --target=wasm32-linux-muslwali --stdlib=libc++ %s 2>&1 \ |
| 91 |
// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree/usr \ |
| 92 |
// RUN: | FileCheck -check-prefix=COMPILE_WALI %s |
| 93 |
// COMPILE_WALI: "-cc1" |
| 94 |
// COMPILE_WALI: "-resource-dir" "[[RESOURCE_DIR:[^"]*]]" |
| 95 |
// COMPILE_WALI: "-isysroot" "[[SYSROOT:[^"]+]]" |
| 96 |
// COMPILE_WALI: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/wasm32-linux-muslwali/c++/v1" |
| 97 |
// COMPILE_WALI: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/v1" |
| 98 |
// COMPILE_WALI: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" |
| 99 |
// COMPILE_WALI: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/wasm32-linux-muslwali" |
| 100 |
// COMPILE_WALI: "-internal-isystem" "[[SYSROOT:[^"]+]]/include" |
| 101 |
|
| 102 |
// RUN: %clangxx -### --target=wasm32-linux-muslwali --stdlib=libstdc++ %s 2>&1 \ |
| 103 |
// RUN: --sysroot=%S/Inputs/basic_linux_libstdcxx_libcxxv2_tree/usr \ |
| 104 |
// RUN: | FileCheck -check-prefix=COMPILE_WALI_STDCXX %s |
| 105 |
// COMPILE_WALI_STDCXX: "-cc1" |
| 106 |
// COMPILE_WALI_STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]*]]" |
| 107 |
// COMPILE_WALI_STDCXX: "-isysroot" "[[SYSROOT:[^"]+]]" |
| 108 |
// COMPILE_WALI_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/4.8/wasm32-linux-muslwali" |
| 109 |
// COMPILE_WALI_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/4.8" |
| 110 |
// COMPILE_WALI_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/4.8/backward" |
| 111 |
// COMPILE_WALI_STDCXX: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include" |
| 112 |
// COMPILE_WALI_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/wasm32-linux-muslwali" |
| 113 |
// COMPILE_WALI_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include" |