Skip to content

Empty union in initialized with undef values in OG and with zeroinitializer in CIR #1272

Open
@bcardosolopes

Description

@bcardosolopes

There are some differences from the OG LLVM for unions for C++ code...

The empty union in initialized with undef values in OG and with zeroinitializer in CIR:

union U { int a; long long b;};
union U u = {};
// OG
@u = dso_local global { i32, [4 x i8] } { i32 0, [4 x i8] undef }, align 8

// CIR enabled
@u = global { i32, [4 x i8] } zeroinitializer, align  8

This is a difference - and soon or later we may want to fix it.

Originally posted by @gitoleg in #1257 (comment)

Metadata

Metadata

Assignees

Labels

IR differenceA difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions