|
33 | 33 | // LINK_KNOWN: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"
|
34 | 34 | // LINK_KNOWN: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"
|
35 | 35 |
|
| 36 | +// -shared should be passed through to `wasm-ld` and not include crt1.o with a known OS. |
| 37 | + |
| 38 | +// RUN: %clang -### -shared --target=wasm32-wasi --sysroot=/foo %s 2>&1 \ |
| 39 | +// RUN: | FileCheck -check-prefix=LINK_KNOWN_SHARED %s |
| 40 | +// LINK_KNOWN_SHARED: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 41 | +// LINK_KNOWN_SHARED: wasm-ld{{.*}}" "-L/foo/lib/wasm32-wasi" "-shared" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" |
| 42 | + |
| 43 | +// -shared should be passed through to `wasm-ld` and not include crt1.o with an unknown OS. |
| 44 | + |
| 45 | +// RUN: %clang -### -shared --target=wasm32-unknown-unknown --sysroot=/foo %s 2>&1 \ |
| 46 | +// RUN: | FileCheck -check-prefix=LINK_UNKNOWN_SHARED %s |
| 47 | +// LINK_UNKNOWN_SHARED: "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 48 | +// LINK_UNKNOWN_SHARED: wasm-ld{{.*}}" "-shared" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out" |
| 49 | + |
36 | 50 | // A basic C link command-line with optimization with known OS.
|
37 | 51 |
|
38 | 52 | // RUN: %clang -### -O2 --target=wasm32-wasi --sysroot=/foo %s 2>&1 \
|
|
46 | 60 | // RUN: | FileCheck -check-prefix=COMPILE %s
|
47 | 61 | // COMPILE: "-cc1" {{.*}} "-internal-isystem" "/foo/include/wasm32-wasi" "-internal-isystem" "/foo/include"
|
48 | 62 |
|
| 63 | +// -fPIC should work on a known OS |
| 64 | + |
| 65 | +// RUN: %clang -### -fPIC --target=wasm32-wasi --sysroot=/foo %s 2>&1 \ |
| 66 | +// RUN: | FileCheck -check-prefix=COMPILE_KNOWN_PIC %s |
| 67 | +// COMPILE_KNOWN_PIC: "-cc1" {{.*}} "-mrelocation-model" "pic" "-pic-level" "2" {{.*}} "-internal-isystem" "/foo/include/wasm32-wasi" "-internal-isystem" "/foo/include" |
| 68 | + |
| 69 | +// -fPIC should work on an unknown OS |
| 70 | + |
| 71 | +// RUN: %clang -### -fPIC --target=wasm32-unknown-unknown --sysroot=/foo %s 2>&1 \ |
| 72 | +// RUN: | FileCheck -check-prefix=COMPILE_UNKNOWN_PIC %s |
| 73 | +// COMPILE_UNKNOWN_PIC: "-cc1" {{.*}} "-mrelocation-model" "pic" "-pic-level" "2" |
| 74 | + |
49 | 75 | // Thread-related command line tests.
|
50 | 76 |
|
51 | 77 | // '-pthread' sets +atomics, +bulk-memory, +mutable-globals, +sign-ext, and --shared-memory
|
|
0 commit comments