Skip to content

Commit 65c86d3

Browse files
committed
Skip certain test cases if using dynamic linking
In the test suite, because certain test cases are used to validate the built-in C library, these tests are unnecessary for the dynamic linking mode. Therefore, this commit makes the test suite to skip specific cases when validating the dynamically linked compiler.
1 parent eed0e7b commit 65c86d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/driver.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ esac
5757

5858
if [ $# -ge 2 ] && [ "$2" = "dynamic" ]; then
5959
readonly SHECC_CFLAGS="--dynlink"
60+
readonly LINK_MODE="dynamic"
6061
else
6162
readonly SHECC_CFLAGS=""
63+
readonly LINK_MODE="static"
6264
fi
6365

6466
# Utility Functions
@@ -2098,6 +2100,7 @@ EOF
20982100
# Category: Memory Management
20992101
begin_category "Memory Management" "Testing malloc, free, and dynamic memory allocation"
21002102

2103+
if [ "$LINK_MODE" = "static" ]; then
21012104
# malloc and free
21022105
try_ 1 << EOF
21032106
int main()
@@ -2113,6 +2116,9 @@ int main()
21132116
return a == b;
21142117
}
21152118
EOF
2119+
else
2120+
echo "Skip test cases in dynamic linking mode"
2121+
fi # "LINK_MODE" = "static"
21162122

21172123
try_ 1 << EOF
21182124
int main()
@@ -3228,6 +3234,8 @@ int main()
32283234
}
32293235
EOF
32303236

3237+
if [ "$LINK_MODE" = "static" ]; then
3238+
32313239
# printf family, including truncation and zero size input
32323240
try_output 11 "Hello World" << EOF
32333241
int main() {
@@ -3387,6 +3395,9 @@ int main()
33873395
return c == -1;
33883396
}
33893397
EOF
3398+
else
3399+
echo "Skip test cases in dynamic linking mode"
3400+
fi # "LINK_MODE" = "static"
33903401

33913402
# tests integer type conversion
33923403
# excerpted and modified from issue #166

0 commit comments

Comments
 (0)