Skip to content

Commit 3206162

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 6a976c0 commit 3206162

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
@@ -2224,6 +2226,7 @@ EOF
22242226
# Category: Memory Management
22252227
begin_category "Memory Management" "Testing malloc, free, and dynamic memory allocation"
22262228

2229+
if [ "$LINK_MODE" = "static" ]; then
22272230
# malloc and free
22282231
try_ 1 << EOF
22292232
int main()
@@ -2239,6 +2242,9 @@ int main()
22392242
return a == b;
22402243
}
22412244
EOF
2245+
else
2246+
echo "Skip test cases because of using dynamic linking mode"
2247+
fi # "LINK_MODE" = "static"
22422248

22432249
try_ 1 << EOF
22442250
int main()
@@ -3484,6 +3490,8 @@ int main()
34843490
}
34853491
EOF
34863492

3493+
if [ "$LINK_MODE" = "static" ]; then
3494+
34873495
# printf family, including truncation and zero size input
34883496
try_output 11 "Hello World" << EOF
34893497
int main() {
@@ -3643,6 +3651,9 @@ int main()
36433651
return c == -1;
36443652
}
36453653
EOF
3654+
else
3655+
echo "Skip test cases because of using dynamic linking mode"
3656+
fi # "LINK_MODE" = "static"
36463657

36473658
# tests integer type conversion
36483659
# excerpted and modified from issue #166

0 commit comments

Comments
 (0)