Skip to content

UTBotCpp does not support thread-local variables #616

@IDKWNTCMF

Description

@IDKWNTCMF

Description
If there is a global thread-local variable in the project, then generated tests cannot be run.

Example

__thread int thread_local_id;

void set_id(int id) {
    thread_local_id = id + 5;
}

To Reproduce
Steps to reproduce the behavior:

  1. Copy the example above to your project
  2. Generate tests for some function
  3. Try to run generated tests

Expected behavior
Tests are supposed to be executed successfully.

Actual behavior
Tests cannot be built and executed.

Visual proofs (screenshots, logs)

/home/utbot/UTBotCpp/integration-tests/c-example/utbot_tests/makefiles/lib/keywords/../../../../utbot_tests/wrapper/lib/keywords/qualifiers_wrapper.c:7:61: error: initializer element is not a compile-time constant
__thread int (*thread_local_id_lib_keywords_qualifiers_c) = &thread_local_id;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions