Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Fix test 3 thread failure #1955

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

king258436
Copy link

@king258436 king258436 commented Sep 1, 2024

Fix tests/s-thread.c failure from compiler optimization in ubuntu24.04

$ clang -v
Ubuntu clang version 18.1.3 (1ubuntu1)
t003_thread: diff result of clang -pg -O3 
--- expect      2024-09-02 21:38:09.576036102 +0900
+++ result      2024-09-02 21:38:09.576036102 +0900
@@ -21,4 +21,2 @@
      b() {
-       c() {
-       } /* c */
      } /* b */
@@ -29,4 +27,2 @@
      b() {
-       c() {
-       } /* c */
      } /* b */
@@ -37,4 +33,2 @@
      b() {
-       c() {
-       } /* c */
      } /* b */
@@ -45,4 +39,2 @@
      b() {
-       c() {
-       } /* c */
      } /* b */

003 thread              : OK OK OK OK OK  OK OK OK NG OK

Copy link
Owner

@namhyung namhyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. But can you please add a compiler warning or something to say why it failed? See commit 887f8d2 for example.

@MichelleJin12
Copy link
Contributor

Hi @king258436

You can run
python3 runtest.py 003
python3 runtest.py 003 -c clang -O 3 -p -v
to generate expect and result outputs

@yskelg
Copy link
Contributor

yskelg commented Sep 2, 2024

Thank you @king258436! You can find the verbose results with -vdp options. See #1580

Fix tests/s-thread.c failure from compiler optimization in ubuntu24.04,
clang version 18.1.3

Signed-off-by: choi wonsick <[email protected]>
@king258436
Copy link
Author

Looks good to me. But can you please add a compiler warning or something to say why it failed? See commit 887f8d2 for example.

I have updated your feedback. Thank you @namhyung very much for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants