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

[LLVM error] msgpack-d 0.9.3 unittesting fails #841

Closed
drug007 opened this issue Feb 16, 2015 · 4 comments
Closed

[LLVM error] msgpack-d 0.9.3 unittesting fails #841

drug007 opened this issue Feb 16, 2015 · 4 comments
Assignees
Labels

Comments

@drug007
Copy link

drug007 commented Feb 16, 2015

this command:
drug@astra:~/.dub/packages/msgpack-d-0.9.3$ dub --build=unittest --compiler=ldmd2

fails with the result:

The determined compiler type "ldc" doesn't match the expected type "dmd". This will probably result in build errors.
Building msgpack-d 0.9.3 configuration "library", build type unittest.
Running ldmd2...
Stored value type does not match pointer operand type!
  store [2 x i8]* %18, [2 x i8]* %22, !dbg !10792
 [2 x i8]Stored value type does not match pointer operand type!
  store [2 x i8]* %23, [2 x i8]* %27, !dbg !10792
 [2 x i8]LLVM ERROR: Broken function found, compilation aborted!
FAIL .dub/build/library-unittest-linux.posix-x86_64-ldc_2066-28222C70EA831B74411B8A9C9233AD02/ msgpack-d staticLibrary
Error executing command run:
ldmd2 failed with exit code 1. 

Without the unittest option all works fine.
Compiler version is:

drug@astra:~/.dub/packages/msgpack-d-0.9.3$ ldmd2
LDC - the LLVM D compiler (0.15.0):
  based on DMD v2.066.1 and LLVM 3.5.0
  Default target: x86_64-pc-linux-gnu
  Host CPU: core-avx-i 
@redstar
Copy link
Member

redstar commented Feb 28, 2015

Reduced test case for master:

struct Foo
{
    static union Bar
    {
        bool b;
        ulong l;
    }

    Bar bar;
}

static this()
{
    Foo foo = Foo();
}

But this is not the initial error from 0.15.1.

redstar added a commit to redstar/ldc that referenced this issue Feb 28, 2015
The `union` is not created as packed type. This seems to create problems with the default initializer:

    struct Foo
    {
        static union Bar
        {
            bool b;
            ulong l;
        }

        Bar bar;
    }

    static this()
    {
        Foo foo = Foo();
    }

creates an error. If you change the order inside the union

        static union Bar
        {
            ulong l;
            bool b;
        }

then the code works.

Also cleans up the creation of the additonal zeroes for the initializer.
@redstar redstar self-assigned this Feb 28, 2015
redstar added a commit that referenced this issue Feb 28, 2015
@redstar
Copy link
Member

redstar commented Feb 28, 2015

Fixed in master. Could you please check?

@drug007
Copy link
Author

drug007 commented Mar 3, 2015

Sorry for delay, it works now.

@redstar
Copy link
Member

redstar commented Mar 6, 2015

Thanks!

@redstar redstar closed this as completed Mar 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants