2018-01-13 01:54:49 +08:00
|
|
|
// A basic clang -cc1 command-line. WebAssembly is somewhat special in
|
2018-02-01 02:55:22 +08:00
|
|
|
// enabling -fvisibility=hidden by default.
|
2018-01-13 01:54:49 +08:00
|
|
|
|
2019-06-11 00:18:04 +08:00
|
|
|
// RUN: %clangxx %s -### -no-canonical-prefixes -target wasm32-unknown-unknown 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CC1 %s
|
2018-02-01 02:55:22 +08:00
|
|
|
// CC1: clang{{.*}} "-cc1" "-triple" "wasm32-unknown-unknown" {{.*}} "-fvisibility" "hidden" {{.*}}
|
2018-01-13 01:54:49 +08:00
|
|
|
|
|
|
|
// Ditto, but ensure that a user -fvisibility=default disables the default
|
|
|
|
// -fvisibility=hidden.
|
|
|
|
|
2019-06-11 00:18:04 +08:00
|
|
|
// RUN: %clangxx %s -### -target wasm32-unknown-unknown -fvisibility=default 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=FVISIBILITY_DEFAULT %s
|
2018-01-13 01:54:49 +08:00
|
|
|
// FVISIBILITY_DEFAULT-NOT: hidden
|
|
|
|
|
2019-01-15 14:58:16 +08:00
|
|
|
// A basic C++ link command-line with unknown OS.
|
2018-01-13 01:54:49 +08:00
|
|
|
|
2019-06-11 00:18:04 +08:00
|
|
|
// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo --stdlib=c++ %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=LINK %s
|
2018-01-13 01:54:49 +08:00
|
|
|
// LINK: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"
|
2018-08-08 02:55:41 +08:00
|
|
|
// LINK: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"
|
2018-01-13 01:54:49 +08:00
|
|
|
|
2019-01-15 14:58:16 +08:00
|
|
|
// A basic C++ link command-line with optimization with unknown OS.
|
2018-01-13 01:54:49 +08:00
|
|
|
|
2019-06-11 00:18:04 +08:00
|
|
|
// RUN: %clangxx -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s --stdlib=c++ 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=LINK_OPT %s
|
2018-01-13 01:54:49 +08:00
|
|
|
// LINK_OPT: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"
|
2018-08-08 02:55:41 +08:00
|
|
|
// LINK_OPT: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"
|
2019-01-15 14:58:16 +08:00
|
|
|
|
|
|
|
// A basic C++ link command-line with known OS.
|
|
|
|
|
2019-06-11 00:18:04 +08:00
|
|
|
// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-wasi --sysroot=/foo --stdlib=c++ %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=LINK_KNOWN %s
|
2019-01-15 14:58:16 +08:00
|
|
|
// LINK_KNOWN: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"
|
2019-05-01 07:06:07 +08:00
|
|
|
// LINK_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"
|
2019-01-15 14:58:16 +08:00
|
|
|
|
|
|
|
// A basic C++ link command-line with optimization with known OS.
|
|
|
|
|
2019-06-11 00:18:04 +08:00
|
|
|
// RUN: %clangxx -### -O2 -no-canonical-prefixes -target wasm32-wasi --sysroot=/foo %s --stdlib=c++ 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=LINK_OPT_KNOWN %s
|
2019-01-15 14:58:16 +08:00
|
|
|
// LINK_OPT_KNOWN: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"
|
2019-05-01 07:06:07 +08:00
|
|
|
// LINK_OPT_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"
|
2019-01-15 14:58:16 +08:00
|
|
|
|
|
|
|
// A basic C++ compile command-line with known OS.
|
|
|
|
|
2019-06-11 00:18:04 +08:00
|
|
|
// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-wasi --sysroot=/foo --stdlib=c++ %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=COMPILE %s
|
|
|
|
// COMPILE: clang{{.*}}" "-cc1"
|
2019-06-13 17:42:43 +08:00
|
|
|
// COMPILE: "-resource-dir" "[[RESOURCE_DIR:[^"]*]]"
|
2019-06-11 00:18:04 +08:00
|
|
|
// COMPILE: "-isysroot" "/foo"
|
|
|
|
// COMPILE: "-internal-isystem" "/foo/include/wasm32-wasi/c++/v1"
|
|
|
|
// COMPILE: "-internal-isystem" "/foo/include/c++/v1"
|
2019-06-13 17:42:43 +08:00
|
|
|
// COMPILE: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
|
2019-06-11 00:18:04 +08:00
|
|
|
// COMPILE: "-internal-isystem" "/foo/include/wasm32-wasi"
|
|
|
|
// COMPILE: "-internal-isystem" "/foo/include"
|