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

Test05 is flawed #24

Open
paulhankin opened this issue Sep 23, 2021 · 0 comments
Open

Test05 is flawed #24

paulhankin opened this issue Sep 23, 2021 · 0 comments

Comments

@paulhankin
Copy link

Test05 currently fails with a crash.

The comments and print statement suggest that the expected behavior is as it is, but the behavior (as the comments also suggest) is undefined behavior.

There's several problems with this test:

  1. The test fails, even though the behavior is as expected.
  2. It's undefined behavior, so there is no guarantee what the test does.
  3. Even if the runtime is supposed to support specific behavior when one tries to recursively init a local static, any code that contains this construct exhibits undefined behavior and is therefore already faulty.

Here's an example running the test:

$ dbt run "//libsupcxx/tests/Test05" cc-toolchain=linux-x86_64-libsupcxx

Running libsupcxx/tests/Test05:
Getting the meaning of life!
Computing the meaning of life!
Answer to the Ultimate Question of Life, the Universe, and Everything: 42
Getting the meaning of life!
Answer to the Ultimate Question of Life, the Universe, and Everything: 42
recursiveInit(0)!
recursiveInit(1)!
FAILED: libsupcxx/tests/Test05#run
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

No branches or pull requests

1 participant