test: Fix testcase 84#1954
Open
gyuha-wa-vect0r wants to merge 1 commit intonamhyung:masterfrom
Open
Conversation
honggyukim
reviewed
Sep 1, 2024
Collaborator
There was a problem hiding this comment.
Thanks for the patch, but your description doesn't explain what the problem is.
I would rephrase the problem statement as follows.
In 84 arg_mixed test, the mixed_sub is renamed to mixed_sub.specialized.1 in clang optimized builds so the test fails as follows.
$ ./runtest.py -vdp -O1 -c clang 084
...
t084_arg_mixed: diff result of clang -pg -O1
--- expect 2024-09-01 22:24:43.922522624 +0900
+++ result 2024-09-01 22:24:43.922522624 +0900
@@ -2,3 +2,3 @@
mixed_add(-1, 0.200000) = -0.800000;
- mixed_sub(0x400000, 2048) = 0x3ff800;
+ mixed_sub.specialized.1();
mixed_mul(-3.000000, 80000000000) = -240000000000;
084 arg_mixed : NGThis can be fixed as follows.
diff --git a/tests/s-exp-mixed.c b/tests/s-exp-mixed.c
index 1e51173b..9f678937 100644
--- a/tests/s-exp-mixed.c
+++ b/tests/s-exp-mixed.c
@@ -7,6 +7,9 @@ double mixed_add(int a, float b)
return a + b;
}
+#if __clang__
+__attribute__((optnone))
+#endif
long mixed_sub(void *a, unsigned long b)
{
return (long)a - b;But I think it's not easy to pick which functions can be renamed due to clang optimization. @namhyung Do you have any better idea?
Owner
|
I don't know if clang has an option to prevent the specialization. |
Fix testcase 84 arg_mixed in ubuntu24.04 In 84 arg_mixed test, the mixed_sub is renamed to mixed_sub.specialized.1 in clang optimized builds so the test fails. Fix not to optimize in mixed_sub function. Signed-off-by: GYUHA LEE <leejune30@chungbuk.ac.kr>
ceac7d4 to
fc1656c
Compare
Author
|
@honggyukim I fixed as you mentioned! Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix testcase 84 arg_mixed in ubuntu24.04
In 84 arg_mixed test, the mixed_sub is renamed to mixed_sub.specialized.1
in clang optimized builds so the test fails.
Fix not to optimize in mixed_sub function.
Start 1 tests without worker pool
Compiler gcc clang
Runtime test case pg finstrument-fu fpatchable-fun pg finstrument-fu fpatchable-fun
------------------------: O0 O1 O2 O3 Os O0 O1 O2 O3 Os O0 O1 O2 O3 Os O0 O1 O2 O3 Os O0 O1 O2 O3 Os O0 O1 O2 O3 Os
084 arg_mixed : OK OK OK OK OK SK SK SK SK SK OK OK OK OK OK OK OK OK OK OK SK SK SK SK SK OK OK OK OK OK