Dan Gohman | 4e48020 | 2016-01-07 00:32:04 +0000 | [diff] [blame] | 1 | // A basic clang -cc1 command-line. |
| 2 | |
| 3 | // RUN: %clang %s -### -target wasm32-unknown-unknown 2>&1 | FileCheck -check-prefix=CC1 %s |
Dan Gohman | a5b804b | 2016-01-07 00:50:27 +0000 | [diff] [blame^] | 4 | // CC1: clang{{.*}} "-cc1" "-triple" "wasm32-unknown-unknown" {{.*}} "-ffunction-sections" "-fdata-sections" |
| 5 | |
| 6 | // Ditto, but ensure that a user -fno-function-sections disables the |
| 7 | // default -ffunction-sections. |
| 8 | |
| 9 | // RUN: %clang %s -### -target wasm32-unknown-unknown -fno-function-sections 2>&1 | FileCheck -check-prefix=NO_FUNCTION_SECTIONS %s |
| 10 | // NO_FUNCTION_SECTIONS-NOT: function-sections |
| 11 | |
| 12 | // Ditto, but ensure that a user -fno-data-sections disables the |
| 13 | // default -fdata-sections. |
| 14 | |
| 15 | // RUN: %clang %s -### -target wasm32-unknown-unknown -fno-data-sections 2>&1 | FileCheck -check-prefix=NO_DATA_SECTIONS %s |
| 16 | // NO_DATA_SECTIONS-NOT: data-sections |
Dan Gohman | 4e48020 | 2016-01-07 00:32:04 +0000 | [diff] [blame] | 17 | |
| 18 | // A basic C link command-line. |
| 19 | |
| 20 | // RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown %s 2>&1 | FileCheck -check-prefix=LINK %s |
| 21 | // LINK: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 22 | // LINK: lld{{.*}}" "-flavor" "ld" "[[temp]]" "-o" "a.out" |
| 23 | |
| 24 | // A basic C link command-line with optimization. |
| 25 | |
| 26 | // RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown %s 2>&1 | FileCheck -check-prefix=LINK_OPT %s |
| 27 | // LINK_OPT: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 28 | // LINK_OPT: lld{{.*}}" "-flavor" "ld" "--gc-sections" "[[temp]]" "-o" "a.out" |
| 29 | |
| 30 | // Ditto, but ensure that a user --no-gc-sections comes after the |
| 31 | // default --gc-sections. |
| 32 | |
| 33 | // RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown -Wl,--no-gc-sections %s 2>&1 | FileCheck -check-prefix=NO_GC_SECTIONS %s |
| 34 | // NO_GC_SECTIONS: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" |
| 35 | // NO_GC_SECTIONS: lld{{.*}}" "-flavor" "ld" "--gc-sections" "--no-gc-sections" "[[temp]]" "-o" "a.out" |