Skip to content

Test05 is flawed #24

Description

@paulhankin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions