@@ -25,152 +25,152 @@ if [ "${USING_CONTAINER_RUSTC:-}" = 1 ]; then
25
25
rustup target add " $target "
26
26
fi
27
27
28
- # Test our implementation
29
- if [ " ${BUILD_ONLY:- } " = " 1" ]; then
30
- echo " no tests to run for build-only targets"
31
- else
32
- test_builtins=(cargo test --package builtins-test --no-fail-fast --target " $target " )
33
- " ${test_builtins[@]} "
34
- " ${test_builtins[@]} " --release
35
- " ${test_builtins[@]} " --features c
36
- " ${test_builtins[@]} " --features c --release
37
- " ${test_builtins[@]} " --features no-asm
38
- " ${test_builtins[@]} " --features no-asm --release
39
- " ${test_builtins[@]} " --features no-f16-f128
40
- " ${test_builtins[@]} " --features no-f16-f128 --release
41
- " ${test_builtins[@]} " --benches
42
- " ${test_builtins[@]} " --benches --release
43
-
44
- if [ " ${TEST_VERBATIM:- } " = " 1" ]; then
45
- verb_path=$( cmd.exe //C echo \\\\ ? \\ %cd%\\ builtins-test\\ target2)
46
- " ${test_builtins[@]} " --target-dir " $verb_path " --features c
47
- fi
48
- fi
49
-
50
-
51
- declare -a rlib_paths
52
-
53
- # Set the `rlib_paths` global array to a list of all compiler-builtins rlibs
54
- update_rlib_paths () {
55
- if [ -d /builtins-target ]; then
56
- rlib_paths=( /builtins-target/" ${target} " /debug/deps/libcompiler_builtins-* .rlib )
57
- else
58
- rlib_paths=( target/" ${target} " /debug/deps/libcompiler_builtins-* .rlib )
59
- fi
60
- }
61
-
62
- # Remove any existing artifacts from previous tests that don't set #![compiler_builtins]
63
- update_rlib_paths
64
- rm -f " ${rlib_paths[@]} "
65
-
66
- cargo build -p compiler_builtins --target " $target "
67
- cargo build -p compiler_builtins --target " $target " --release
68
- cargo build -p compiler_builtins --target " $target " --features c
69
- cargo build -p compiler_builtins --target " $target " --features c --release
70
- cargo build -p compiler_builtins --target " $target " --features no-asm
71
- cargo build -p compiler_builtins --target " $target " --features no-asm --release
72
- cargo build -p compiler_builtins --target " $target " --features no-f16-f128
73
- cargo build -p compiler_builtins --target " $target " --features no-f16-f128 --release
74
-
75
- PREFIX=${target// unknown-/ } -
76
- case " $target " in
77
- armv7-* )
78
- PREFIX=arm-linux-gnueabihf-
79
- ;;
80
- thumb* )
81
- PREFIX=arm-none-eabi-
82
- ;;
83
- * 86* -* )
84
- PREFIX=
85
- ;;
86
- esac
87
-
88
- NM=$( find " $( rustc --print sysroot) " \( -name llvm-nm -o -name llvm-nm.exe \) )
89
- if [ " $NM " = " " ]; then
90
- NM=" ${PREFIX} nm"
91
- fi
92
-
93
- # i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with
94
- # rustup run to ensure that those are in PATH.
95
- TOOLCHAIN=" $( rustup show active-toolchain | sed ' s/ (default)//' ) "
96
- if [[ " $TOOLCHAIN " == * i686-pc-windows-gnu ]]; then
97
- NM=" rustup run $TOOLCHAIN $NM "
98
- fi
99
-
100
- # Look out for duplicated symbols when we include the compiler-rt (C) implementation
101
- update_rlib_paths
102
- for rlib in " ${rlib_paths[@]} " ; do
103
- set +x
104
- echo " ================================================================"
105
- echo " checking $rlib for duplicate symbols"
106
- echo " ================================================================"
107
- set -x
28
+ # # Test our implementation
29
+ # if [ "${BUILD_ONLY:-}" = "1" ]; then
30
+ # echo "no tests to run for build-only targets"
31
+ # else
32
+ # test_builtins=(cargo test --package builtins-test --no-fail-fast --target "$target")
33
+ # "${test_builtins[@]}"
34
+ # "${test_builtins[@]}" --release
35
+ # "${test_builtins[@]}" --features c
36
+ # "${test_builtins[@]}" --features c --release
37
+ # "${test_builtins[@]}" --features no-asm
38
+ # "${test_builtins[@]}" --features no-asm --release
39
+ # "${test_builtins[@]}" --features no-f16-f128
40
+ # "${test_builtins[@]}" --features no-f16-f128 --release
41
+ # "${test_builtins[@]}" --benches
42
+ # "${test_builtins[@]}" --benches --release
43
+
44
+ # if [ "${TEST_VERBATIM:-}" = "1" ]; then
45
+ # verb_path=$(cmd.exe //C echo \\\\?\\%cd%\\builtins-test\\target2)
46
+ # "${test_builtins[@]}" --target-dir "$verb_path" --features c
47
+ # fi
48
+ # fi
49
+
50
+
51
+ # declare -a rlib_paths
52
+
53
+ # # Set the `rlib_paths` global array to a list of all compiler-builtins rlibs
54
+ # update_rlib_paths() {
55
+ # if [ -d /builtins-target ]; then
56
+ # rlib_paths=( /builtins-target/"${target}"/debug/deps/libcompiler_builtins-*.rlib )
57
+ # else
58
+ # rlib_paths=( target/"${target}"/debug/deps/libcompiler_builtins-*.rlib )
59
+ # fi
60
+ # }
61
+
62
+ # # Remove any existing artifacts from previous tests that don't set #![compiler_builtins]
63
+ # update_rlib_paths
64
+ # rm -f "${rlib_paths[@]}"
65
+
66
+ # cargo build -p compiler_builtins --target "$target"
67
+ # cargo build -p compiler_builtins --target "$target" --release
68
+ # cargo build -p compiler_builtins --target "$target" --features c
69
+ # cargo build -p compiler_builtins --target "$target" --features c --release
70
+ # cargo build -p compiler_builtins --target "$target" --features no-asm
71
+ # cargo build -p compiler_builtins --target "$target" --features no-asm --release
72
+ # cargo build -p compiler_builtins --target "$target" --features no-f16-f128
73
+ # cargo build -p compiler_builtins --target "$target" --features no-f16-f128 --release
74
+
75
+ # PREFIX=${target//unknown-/}-
76
+ # case "$target" in
77
+ # armv7-*)
78
+ # PREFIX=arm-linux-gnueabihf-
79
+ # ;;
80
+ # thumb*)
81
+ # PREFIX=arm-none-eabi-
82
+ # ;;
83
+ # *86*-*)
84
+ # PREFIX=
85
+ # ;;
86
+ # esac
87
+
88
+ # NM=$(find "$(rustc --print sysroot)" \( -name llvm-nm -o -name llvm-nm.exe \) )
89
+ # if [ "$NM" = "" ]; then
90
+ # NM="${PREFIX}nm"
91
+ # fi
92
+
93
+ # # i686-pc-windows-gnu tools have a dependency on some DLLs, so run it with
94
+ # # rustup run to ensure that those are in PATH.
95
+ # TOOLCHAIN="$(rustup show active-toolchain | sed 's/ (default)//')"
96
+ # if [[ "$TOOLCHAIN" == *i686-pc-windows-gnu ]]; then
97
+ # NM="rustup run $TOOLCHAIN $NM"
98
+ # fi
99
+
100
+ # # Look out for duplicated symbols when we include the compiler-rt (C) implementation
101
+ # update_rlib_paths
102
+ # for rlib in "${rlib_paths[@]}"; do
103
+ # set +x
104
+ # echo "================================================================"
105
+ # echo "checking $rlib for duplicate symbols"
106
+ # echo "================================================================"
107
+ # set -x
108
108
109
- duplicates_found=0
110
-
111
- # NOTE On i586, It's normal that the get_pc_thunk symbol appears several
112
- # times so ignore it
113
- $NM -g --defined-only " $rlib " 2>&1 |
114
- sort |
115
- uniq -d |
116
- grep -v __x86.get_pc_thunk --quiet |
117
- grep ' T __' && duplicates_found=1
118
-
119
- if [ " $duplicates_found " != 0 ]; then
120
- echo " error: found duplicate symbols"
121
- exit 1
122
- else
123
- echo " success; no duplicate symbols found"
124
- fi
125
- done
126
-
127
- rm -f " ${rlib_paths[@]} "
128
-
129
- build_intrinsics_test () {
130
- cargo build \
131
- --target " $target " --verbose \
132
- --manifest-path builtins-test-intrinsics/Cargo.toml " $@ "
133
- }
134
-
135
- # Verify that we haven't dropped any intrinsics/symbols
136
- build_intrinsics_test
137
- build_intrinsics_test --release
138
- build_intrinsics_test --features c
139
- build_intrinsics_test --features c --release
140
-
141
- # Verify that there are no undefined symbols to `panic` within our
142
- # implementations
143
- CARGO_PROFILE_DEV_LTO=true build_intrinsics_test
144
- CARGO_PROFILE_RELEASE_LTO=true build_intrinsics_test --release
145
-
146
- # Ensure no references to any symbols from core
147
- update_rlib_paths
148
- for rlib in " ${rlib_paths[@]} " ; do
149
- set +x
150
- echo " ================================================================"
151
- echo " checking $rlib for references to core"
152
- echo " ================================================================"
153
- set -x
154
-
155
- tmpdir=" ${CARGO_TARGET_DIR:- target} /tmp"
156
- test -d " $tmpdir " || mkdir " $tmpdir "
157
- defined=" $tmpdir /defined_symbols.txt"
158
- undefined=" $tmpdir /defined_symbols.txt"
159
-
160
- $NM --quiet -U " $rlib " | grep ' T _ZN4core' | awk ' {print $3}' | sort | uniq > " $defined "
161
- $NM --quiet -u " $rlib " | grep ' U _ZN4core' | awk ' {print $2}' | sort | uniq > " $undefined "
162
- grep_has_results=0
163
- grep -v -F -x -f " $defined " " $undefined " && grep_has_results=1
164
-
165
- if [ " $target " = " powerpc64-unknown-linux-gnu" ]; then
166
- echo " FIXME: powerpc64 fails these tests"
167
- elif [ " $grep_has_results " != 0 ]; then
168
- echo " error: found unexpected references to core"
169
- exit 1
170
- else
171
- echo " success; no references to core found"
172
- fi
173
- done
109
+ # duplicates_found=0
110
+
111
+ # # NOTE On i586, It's normal that the get_pc_thunk symbol appears several
112
+ # # times so ignore it
113
+ # $NM -g --defined-only "$rlib" 2>&1 |
114
+ # sort |
115
+ # uniq -d |
116
+ # grep -v __x86.get_pc_thunk --quiet |
117
+ # grep 'T __' && duplicates_found=1
118
+
119
+ # if [ "$duplicates_found" != 0 ]; then
120
+ # echo "error: found duplicate symbols"
121
+ # exit 1
122
+ # else
123
+ # echo "success; no duplicate symbols found"
124
+ # fi
125
+ # done
126
+
127
+ # rm -f "${rlib_paths[@]}"
128
+
129
+ # build_intrinsics_test() {
130
+ # cargo build \
131
+ # --target "$target" --verbose \
132
+ # --manifest-path builtins-test-intrinsics/Cargo.toml "$@"
133
+ # }
134
+
135
+ # # Verify that we haven't dropped any intrinsics/symbols
136
+ # build_intrinsics_test
137
+ # build_intrinsics_test --release
138
+ # build_intrinsics_test --features c
139
+ # build_intrinsics_test --features c --release
140
+
141
+ # # Verify that there are no undefined symbols to `panic` within our
142
+ # # implementations
143
+ # CARGO_PROFILE_DEV_LTO=true build_intrinsics_test
144
+ # CARGO_PROFILE_RELEASE_LTO=true build_intrinsics_test --release
145
+
146
+ # # Ensure no references to any symbols from core
147
+ # update_rlib_paths
148
+ # for rlib in "${rlib_paths[@]}"; do
149
+ # set +x
150
+ # echo "================================================================"
151
+ # echo "checking $rlib for references to core"
152
+ # echo "================================================================"
153
+ # set -x
154
+
155
+ # tmpdir="${CARGO_TARGET_DIR:-target}/tmp"
156
+ # test -d "$tmpdir" || mkdir "$tmpdir"
157
+ # defined="$tmpdir/defined_symbols.txt"
158
+ # undefined="$tmpdir/defined_symbols.txt"
159
+
160
+ # $NM --quiet -U "$rlib" | grep 'T _ZN4core' | awk '{print $3}' | sort | uniq > "$defined"
161
+ # $NM --quiet -u "$rlib" | grep 'U _ZN4core' | awk '{print $2}' | sort | uniq > "$undefined"
162
+ # grep_has_results=0
163
+ # grep -v -F -x -f "$defined" "$undefined" && grep_has_results=1
164
+
165
+ # if [ "$target" = "powerpc64-unknown-linux-gnu" ]; then
166
+ # echo "FIXME: powerpc64 fails these tests"
167
+ # elif [ "$grep_has_results" != 0 ]; then
168
+ # echo "error: found unexpected references to core"
169
+ # exit 1
170
+ # else
171
+ # echo "success; no references to core found"
172
+ # fi
173
+ # done
174
174
175
175
# Test libm
176
176
0 commit comments