From 9757b1bb904164f1beb89c3c85946a67d92c0e46 Mon Sep 17 00:00:00 2001 From: Robert Konicar Date: Mon, 7 Oct 2024 18:18:02 +0200 Subject: [PATCH 1/2] cg: Use NoCommon codegen option to correctly handle linkage. --- include/vast/CodeGen/CodeGenPolicy.hpp | 1 + include/vast/CodeGen/DefaultCodeGenPolicy.hpp | 4 ++++ include/vast/Dialect/Core/Linkage.hpp | 2 +- lib/vast/CodeGen/DefaultDeclVisitor.cpp | 5 +++-- lib/vast/Dialect/Core/Linkage.cpp | 11 ++++------- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/vast/CodeGen/CodeGenPolicy.hpp b/include/vast/CodeGen/CodeGenPolicy.hpp index a29291d63a..440b6709cd 100644 --- a/include/vast/CodeGen/CodeGenPolicy.hpp +++ b/include/vast/CodeGen/CodeGenPolicy.hpp @@ -16,6 +16,7 @@ namespace vast::cg { virtual missing_return_policy get_missing_return_policy(const clang_function *decl) const = 0; virtual bool skip_function_body(const clang_function *decl) const = 0; virtual bool skip_global_initializer(const clang_var_decl *decl) const = 0; + virtual bool get_no_common() const = 0; }; } // namespace vast::cg diff --git a/include/vast/CodeGen/DefaultCodeGenPolicy.hpp b/include/vast/CodeGen/DefaultCodeGenPolicy.hpp index 2917481d11..66514ca98b 100644 --- a/include/vast/CodeGen/DefaultCodeGenPolicy.hpp +++ b/include/vast/CodeGen/DefaultCodeGenPolicy.hpp @@ -32,6 +32,10 @@ namespace vast::cg { return false; }; + bool get_no_common() const override { + return opts.codegen.NoCommon; + } + protected: cc::action_options &opts; }; diff --git a/include/vast/Dialect/Core/Linkage.hpp b/include/vast/Dialect/Core/Linkage.hpp index 0c612a4052..7005cf0ac1 100644 --- a/include/vast/Dialect/Core/Linkage.hpp +++ b/include/vast/Dialect/Core/Linkage.hpp @@ -17,7 +17,7 @@ namespace vast::core { mlir::SymbolTable::Visibility get_visibility_from_linkage(core::GlobalLinkageKind linkage); core::GlobalLinkageKind get_declarator_linkage( - const clang::DeclaratorDecl *decl, clang::GVALinkage linkage, bool is_constant + const clang::DeclaratorDecl *decl, clang::GVALinkage linkage, bool is_constant, bool no_common ); std::optional< core::GlobalLinkageKind > get_function_linkage(clang::GlobalDecl glob); diff --git a/lib/vast/CodeGen/DefaultDeclVisitor.cpp b/lib/vast/CodeGen/DefaultDeclVisitor.cpp index f02cf00177..8693796430 100644 --- a/lib/vast/CodeGen/DefaultDeclVisitor.cpp +++ b/lib/vast/CodeGen/DefaultDeclVisitor.cpp @@ -216,12 +216,13 @@ namespace vast::cg { .freeze(); }; - auto linkage_builder = [](const clang::VarDecl *decl) { + auto linkage_builder = [&](const clang::VarDecl *decl) { auto gva_linkage = decl->getASTContext().GetGVALinkageForVariable(decl); return core::get_declarator_linkage( decl, gva_linkage, - decl->getType().isConstQualified() + decl->getType().isConstQualified(), + this->policy->get_no_common() ); }; diff --git a/lib/vast/Dialect/Core/Linkage.cpp b/lib/vast/Dialect/Core/Linkage.cpp index 217ef5cad3..e703e50aff 100644 --- a/lib/vast/Dialect/Core/Linkage.cpp +++ b/lib/vast/Dialect/Core/Linkage.cpp @@ -42,12 +42,9 @@ namespace vast::core { VAST_FATAL("No such linkage"); } - bool is_vardecl_strong_definition(const clang::VarDecl* decl) { + bool is_vardecl_strong_definition(const clang::VarDecl* decl, bool nocommon) { auto &actx = decl->getASTContext(); - // TODO: auto nocommon = actx.getCodeGenOpts().NoCommon; - bool nocommon = false; - // Don't give variables common linkage if -fno-common was specified unless it // was overridden by a NoCommon attribute. if ((nocommon || decl->hasAttr< clang::NoCommonAttr >()) && !decl->hasAttr< clang::CommonAttr >()) { @@ -154,7 +151,7 @@ namespace vast::core { } GlobalLinkageKind get_declarator_linkage( - const clang::DeclaratorDecl *decl, clang::GVALinkage linkage, bool is_constant + const clang::DeclaratorDecl *decl, clang::GVALinkage linkage, bool is_constant, bool no_common ) { if (linkage == clang::GVA_Internal) { return GlobalLinkageKind::InternalLinkage; @@ -239,7 +236,7 @@ namespace vast::core { // linkage. if (!opts.CPlusPlus) { if (auto var = clang::dyn_cast< clang::VarDecl >(decl)) { - if (!is_vardecl_strong_definition(var)) { + if (!is_vardecl_strong_definition(var, no_common)) { return GlobalLinkageKind::CommonLinkage; } } @@ -280,7 +277,7 @@ namespace vast::core { } } - return get_declarator_linkage(decl, linkage, /* is const variable */ false); + return get_declarator_linkage(decl, linkage, /* is const variable */ false, /*no common linkage */ true); } mlir::LLVM::Linkage convert_linkage_to_llvm(core::GlobalLinkageKind linkage) { From c467f55594febf08745ee963701b92dc58cfefc6 Mon Sep 17 00:00:00 2001 From: Robert Konicar Date: Mon, 7 Oct 2024 18:18:46 +0200 Subject: [PATCH 2/2] test: Fix linkage for global variables, as default setting from clang is NoCommon. --- test/vast/Dialect/HighLevel/array-a.c | 16 ++++++++-------- test/vast/Dialect/HighLevel/cast-b.c | 2 +- test/vast/Dialect/HighLevel/enum-a.c | 2 +- test/vast/Dialect/HighLevel/glob-linkage-a.c | 2 +- test/vast/Dialect/HighLevel/pointers-b.c | 6 +++--- test/vast/Dialect/HighLevel/qualifiers-e.c | 8 ++++---- test/vast/Dialect/HighLevel/qualifiers-g.c | 4 ++-- test/vast/Dialect/HighLevel/qualifiers-h.c | 14 +++++++------- test/vast/Dialect/HighLevel/qualifiers-i.c | 14 +++++++------- test/vast/Dialect/HighLevel/qualifiers-j.c | 6 +++--- test/vast/Dialect/HighLevel/quirks-n.c | 6 +++--- test/vast/Dialect/HighLevel/storage-a.c | 2 +- test/vast/Dialect/HighLevel/struct-a.c | 4 ++-- test/vast/Dialect/HighLevel/struct-c.c | 2 +- test/vast/Dialect/HighLevel/struct-f.c | 2 +- test/vast/Dialect/HighLevel/union-a.c | 2 +- test/vast/Dialect/HighLevel/union-b.c | 2 +- test/vast/Transform/HL/LowerTypes/array-a.c | 14 +++++++------- 18 files changed, 54 insertions(+), 54 deletions(-) diff --git a/test/vast/Dialect/HighLevel/array-a.c b/test/vast/Dialect/HighLevel/array-a.c index 8fcbda626f..4aacf327a5 100644 --- a/test/vast/Dialect/HighLevel/array-a.c +++ b/test/vast/Dialect/HighLevel/array-a.c @@ -1,26 +1,26 @@ // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - -// CHECK: hl.var @ai, : !hl.lvalue> +// CHECK: hl.var @ai, : !hl.lvalue> int ai[10]; -// CHECK: hl.var @aci, : !hl.lvalue>> +// CHECK: hl.var @aci, : !hl.lvalue>> const int aci[5]; -// CHECK: hl.var @avi, : !hl.lvalue>> +// CHECK: hl.var @avi, : !hl.lvalue>> volatile int avi[5]; -// CHECK: hl.var @acvi, : !hl.lvalue>> +// CHECK: hl.var @acvi, : !hl.lvalue>> const volatile int acvi[5]; -// CHECK: hl.var @acvui, : !hl.lvalue>> +// CHECK: hl.var @acvui, : !hl.lvalue>> const volatile unsigned int acvui[5]; -// CHECK: hl.var @af, : !hl.lvalue> +// CHECK: hl.var @af, : !hl.lvalue> float af[10]; -// CHECK: hl.var @a3d, : !hl.lvalue>>> +// CHECK: hl.var @a3d, : !hl.lvalue>>> float a3d[2][4][3]; -// CHECK: hl.var @ae, : !hl.lvalue> +// CHECK: hl.var @ae, : !hl.lvalue> int ae[4 + 4*100]; diff --git a/test/vast/Dialect/HighLevel/cast-b.c b/test/vast/Dialect/HighLevel/cast-b.c index e413cae7d2..a8b27902aa 100644 --- a/test/vast/Dialect/HighLevel/cast-b.c +++ b/test/vast/Dialect/HighLevel/cast-b.c @@ -4,7 +4,7 @@ // CHECK: hl.typedef @function_type : !core.fn<(!hl.lvalue, !hl.lvalue) -> (!hl.int)> typedef int function_type(int a, int b); -// CHECK: hl.var @p, : !hl.lvalue>>>> +// CHECK: hl.var @p, : !hl.lvalue>>>> function_type *p[2]; int test_func(void) { diff --git a/test/vast/Dialect/HighLevel/enum-a.c b/test/vast/Dialect/HighLevel/enum-a.c index 774f28f0d0..17a029597b 100644 --- a/test/vast/Dialect/HighLevel/enum-a.c +++ b/test/vast/Dialect/HighLevel/enum-a.c @@ -17,5 +17,5 @@ enum color c = GREEN; // CHECK: hl.typedef @color : !hl.elaborated> typedef enum color color; -// CHECK: hl.var @tc, : !hl.lvalue>> +// CHECK: hl.var @tc, : !hl.lvalue>> color tc; diff --git a/test/vast/Dialect/HighLevel/glob-linkage-a.c b/test/vast/Dialect/HighLevel/glob-linkage-a.c index ff9af9b906..fd6c367a93 100644 --- a/test/vast/Dialect/HighLevel/glob-linkage-a.c +++ b/test/vast/Dialect/HighLevel/glob-linkage-a.c @@ -10,7 +10,7 @@ int __attribute__((weak)) wdef = 5; extern int __attribute__((weak)) ewdef = 5; // CHECK: hl.var @edef, extern int edef = 5; -// CHECK: hl.var @undef, +// CHECK: hl.var @undef, int undef; // CHECK: hl.var @def, int def = 5; diff --git a/test/vast/Dialect/HighLevel/pointers-b.c b/test/vast/Dialect/HighLevel/pointers-b.c index 724b3f3c2a..c6ec00838f 100644 --- a/test/vast/Dialect/HighLevel/pointers-b.c +++ b/test/vast/Dialect/HighLevel/pointers-b.c @@ -1,12 +1,12 @@ // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - -// CHECK: hl.var @p, : !hl.lvalue> -// CHECK: hl.var @pp, : !hl.lvalue>> +// CHECK: hl.var @p, : !hl.lvalue> +// CHECK: hl.var @pp, : !hl.lvalue>> float *p, **pp; // p is a pointer to float // pp is a pointer to a pointer to float -// CHECK: hl.var @fp, : !hl.lvalue) -> (!hl.int)>>>> +// CHECK: hl.var @fp, : !hl.lvalue) -> (!hl.int)>>>> int (*fp)(int); // fp is a pointer to function with type int(int) // CHECK: hl.var @pc, : !hl.lvalue>> diff --git a/test/vast/Dialect/HighLevel/qualifiers-e.c b/test/vast/Dialect/HighLevel/qualifiers-e.c index 86cf638cf3..c43a677dea 100644 --- a/test/vast/Dialect/HighLevel/qualifiers-e.c +++ b/test/vast/Dialect/HighLevel/qualifiers-e.c @@ -1,14 +1,14 @@ // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - -// CHECK: hl.var @ia, : !hl.lvalue> +// CHECK: hl.var @ia, : !hl.lvalue> int ia[10]; -// CHECK: hl.var @cia, : !hl.lvalue>> +// CHECK: hl.var @cia, : !hl.lvalue>> const int cia[10]; -// CHECK: hl.var @via, : !hl.lvalue>> +// CHECK: hl.var @via, : !hl.lvalue>> volatile int via[10]; -// CHECK: hl.var @cvia, : !hl.lvalue>> +// CHECK: hl.var @cvia, : !hl.lvalue>> const volatile int cvia[10]; diff --git a/test/vast/Dialect/HighLevel/qualifiers-g.c b/test/vast/Dialect/HighLevel/qualifiers-g.c index 1abc45a971..1da695ef2e 100644 --- a/test/vast/Dialect/HighLevel/qualifiers-g.c +++ b/test/vast/Dialect/HighLevel/qualifiers-g.c @@ -1,8 +1,8 @@ // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - -// CHECK: hl.var @a, : !hl.lvalue> -// CHECK: hl.var @b, : !hl.lvalue> +// CHECK: hl.var @a, : !hl.lvalue> +// CHECK: hl.var @b, : !hl.lvalue> float * restrict a, * restrict b; // CHECK: @f {{.*}} (!hl.lvalue, !hl.lvalue>, !hl.lvalue>) diff --git a/test/vast/Dialect/HighLevel/qualifiers-h.c b/test/vast/Dialect/HighLevel/qualifiers-h.c index 35adb44739..f0f65523b0 100644 --- a/test/vast/Dialect/HighLevel/qualifiers-h.c +++ b/test/vast/Dialect/HighLevel/qualifiers-h.c @@ -4,26 +4,26 @@ // CHECK: hl.enum @e : !hl.int< unsigned > enum e { a, b, c }; -// CHECK: hl.var @v, : !hl.lvalue>> +// CHECK: hl.var @v, : !hl.lvalue>> enum e v; -// CHECK: hl.var @cv, : !hl.lvalue, const >> +// CHECK: hl.var @cv, : !hl.lvalue, const >> const enum e cv; -// CHECK: hl.var @cvv, : !hl.lvalue, const, volatile >> +// CHECK: hl.var @cvv, : !hl.lvalue, const, volatile >> const volatile enum e cvv; // CHECK: hl.typedef @def : !hl.elaborated> typedef enum e def; -// CHECK: hl.var @d, : !hl.lvalue>> +// CHECK: hl.var @d, : !hl.lvalue>> def d; -// CHECK: hl.var @cd, : !hl.lvalue, const >> +// CHECK: hl.var @cd, : !hl.lvalue, const >> const def cd; -// CHECK: hl.var @vd, : !hl.lvalue, volatile >> +// CHECK: hl.var @vd, : !hl.lvalue, volatile >> volatile def vd; -// CHECK: hl.var @cvd, : !hl.lvalue, const, volatile >> +// CHECK: hl.var @cvd, : !hl.lvalue, const, volatile >> const volatile def cvd; diff --git a/test/vast/Dialect/HighLevel/qualifiers-i.c b/test/vast/Dialect/HighLevel/qualifiers-i.c index 93f5c437df..96a410f3ce 100644 --- a/test/vast/Dialect/HighLevel/qualifiers-i.c +++ b/test/vast/Dialect/HighLevel/qualifiers-i.c @@ -4,26 +4,26 @@ // CHECK: hl.union @u union u { int i; double d; }; -// CHECK: hl.var @v, : !hl.lvalue>> +// CHECK: hl.var @v, : !hl.lvalue>> union u v; -// CHECK: hl.var @cv, : !hl.lvalue, const >> +// CHECK: hl.var @cv, : !hl.lvalue, const >> const union u cv; -// CHECK: hl.var @cvv, : !hl.lvalue, const, volatile >> +// CHECK: hl.var @cvv, : !hl.lvalue, const, volatile >> const volatile union u cvv; // CHECK: hl.typedef @e : !hl.elaborated> typedef union u e; -// CHECK: hl.var @v, : !hl.lvalue>> +// CHECK: hl.var @v, : !hl.lvalue>> e v; -// CHECK: hl.var @cv, : !hl.lvalue, const >> +// CHECK: hl.var @cv, : !hl.lvalue, const >> const e cv; -// CHECK: hl.var @vv, : !hl.lvalue, volatile >> +// CHECK: hl.var @vv, : !hl.lvalue, volatile >> volatile e vv; -// CHECK: hl.var @cvv, : !hl.lvalue, const, volatile >> +// CHECK: hl.var @cvv, : !hl.lvalue, const, volatile >> const volatile e cvv; diff --git a/test/vast/Dialect/HighLevel/qualifiers-j.c b/test/vast/Dialect/HighLevel/qualifiers-j.c index 2fed1f8368..d82011180b 100644 --- a/test/vast/Dialect/HighLevel/qualifiers-j.c +++ b/test/vast/Dialect/HighLevel/qualifiers-j.c @@ -1,11 +1,11 @@ // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - -// CHECK: hl.var @fp, : !hl.lvalue) -> (!hl.int)>>>> +// CHECK: hl.var @fp, : !hl.lvalue) -> (!hl.int)>>>> int (*fp) (int); -// CHECK: hl.var @cfp, : !hl.lvalue) -> (!hl.int< const >)>>>> +// CHECK: hl.var @cfp, : !hl.lvalue) -> (!hl.int< const >)>>>> const int (*cfp)(int); -// CHECK: hl.var @fpc, : !hl.lvalue>) -> (!hl.int)>>>> +// CHECK: hl.var @fpc, : !hl.lvalue>) -> (!hl.int)>>>> int (*fpc)(const int); diff --git a/test/vast/Dialect/HighLevel/quirks-n.c b/test/vast/Dialect/HighLevel/quirks-n.c index a541e6a3ab..6e911ccc1e 100644 --- a/test/vast/Dialect/HighLevel/quirks-n.c +++ b/test/vast/Dialect/HighLevel/quirks-n.c @@ -12,9 +12,9 @@ unsigned int typedef u32; // CHECK: hl.typedef @baz : !hl.elaborated, const > struct foo { int bar; } const typedef baz; -// CHECK: hl.var @a, : !hl.lvalue>> +// CHECK: hl.var @a, : !hl.lvalue>> s16 a; -// CHECK: hl.var @b, : !hl.lvalue>> +// CHECK: hl.var @b, : !hl.lvalue>> u32 b; -// CHECK: hl.var @c, : !hl.lvalue>> +// CHECK: hl.var @c, : !hl.lvalue>> baz c; diff --git a/test/vast/Dialect/HighLevel/storage-a.c b/test/vast/Dialect/HighLevel/storage-a.c index 73775514fa..7bcb28d327 100644 --- a/test/vast/Dialect/HighLevel/storage-a.c +++ b/test/vast/Dialect/HighLevel/storage-a.c @@ -1,7 +1,7 @@ // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %file-check %s // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o %t && %vast-opt %t | diff -B %t - -// CHECK: hl.var @i, : !hl.lvalue +// CHECK: hl.var @i, : !hl.lvalue int i; // CHECKL: hl.var @ei, sc_extern : !hl.lvalue diff --git a/test/vast/Dialect/HighLevel/struct-a.c b/test/vast/Dialect/HighLevel/struct-a.c index c29051c364..4c67ae547f 100644 --- a/test/vast/Dialect/HighLevel/struct-a.c +++ b/test/vast/Dialect/HighLevel/struct-a.c @@ -12,7 +12,7 @@ struct pair { int a, b; }; -// CHECK: hl.var @p, : !hl.lvalue>> +// CHECK: hl.var @p, : !hl.lvalue>> struct pair p; struct forward; @@ -33,7 +33,7 @@ typedef struct wrap { int v; } wrap_t; -// CHECK: hl.var @w, : !hl.lvalue>> +// CHECK: hl.var @w, : !hl.lvalue>> wrap_t w; // CHECK: hl.struct @compound : { diff --git a/test/vast/Dialect/HighLevel/struct-c.c b/test/vast/Dialect/HighLevel/struct-c.c index c1f91004b6..885465af8c 100644 --- a/test/vast/Dialect/HighLevel/struct-c.c +++ b/test/vast/Dialect/HighLevel/struct-c.c @@ -4,7 +4,7 @@ // CHECK: hl.struct @"[[N:anonymous\[[0-9]+\]]]" : { // CHECK: hl.field @data : !hl.int // CHECK: } -// CHECK: hl.var @named, : !hl.lvalue>> +// CHECK: hl.var @named, : !hl.lvalue>> struct { int data; } named; diff --git a/test/vast/Dialect/HighLevel/struct-f.c b/test/vast/Dialect/HighLevel/struct-f.c index 0962f22a12..ce995243f6 100644 --- a/test/vast/Dialect/HighLevel/struct-f.c +++ b/test/vast/Dialect/HighLevel/struct-f.c @@ -8,7 +8,7 @@ struct X {}; // CHECK: hl.typedef @X : !hl.elaborated> typedef struct Y {} X; -// CHECK: hl.var @x, : !hl.lvalue>> +// CHECK: hl.var @x, : !hl.lvalue>> // TODO: this is elaborated "X" struct X x; diff --git a/test/vast/Dialect/HighLevel/union-a.c b/test/vast/Dialect/HighLevel/union-a.c index ac50c2ac04..32d4437680 100644 --- a/test/vast/Dialect/HighLevel/union-a.c +++ b/test/vast/Dialect/HighLevel/union-a.c @@ -6,7 +6,7 @@ // CHECK: hl.field @u16 : !hl.array<2, !hl.short< unsigned >> // CHECK: hl.field @u8 : !hl.char< unsigned > // CHECK: } -// CHECK: hl.var @u, : !hl.lvalue> +// CHECK: hl.var @u, : !hl.lvalue> union u { unsigned int u32; unsigned short u16[2]; diff --git a/test/vast/Dialect/HighLevel/union-b.c b/test/vast/Dialect/HighLevel/union-b.c index a2376d283f..a5d95dd4e5 100644 --- a/test/vast/Dialect/HighLevel/union-b.c +++ b/test/vast/Dialect/HighLevel/union-b.c @@ -19,7 +19,7 @@ struct v { // CHECK: hl.field @"[[N5:anonymous\[[0-9]+\]]]" : !hl.record<@"[[N1]]"> // CHECK: hl.field @m : !hl.int int m; -// CHECK: hl.var @v1, : !hl.lvalue>> +// CHECK: hl.var @v1, : !hl.lvalue>> } v1; int main() { diff --git a/test/vast/Transform/HL/LowerTypes/array-a.c b/test/vast/Transform/HL/LowerTypes/array-a.c index c22e0012bb..8eb3d10b68 100644 --- a/test/vast/Transform/HL/LowerTypes/array-a.c +++ b/test/vast/Transform/HL/LowerTypes/array-a.c @@ -1,22 +1,22 @@ // RUN: %vast-cc1 -vast-emit-mlir=hl %s -o - | %vast-opt --vast-hl-lower-types | %file-check %s -// CHECK: hl.var @ai, : !hl.lvalue> +// CHECK: hl.var @ai, : !hl.lvalue> int ai[10]; -// CHECK: hl.var @aci, : !hl.lvalue> +// CHECK: hl.var @aci, : !hl.lvalue> const int aci[5]; -// CHECK: hl.var @avi, : !hl.lvalue> +// CHECK: hl.var @avi, : !hl.lvalue> volatile int avi[5]; -// CHECK: hl.var @acvi, : !hl.lvalue> +// CHECK: hl.var @acvi, : !hl.lvalue> const volatile int acvi[5]; -// CHECK: hl.var @acvui, : !hl.lvalue> +// CHECK: hl.var @acvui, : !hl.lvalue> const volatile unsigned int acvui[5]; -// CHECK: hl.var @af, : !hl.lvalue> +// CHECK: hl.var @af, : !hl.lvalue> float af[10]; -// CHECK: hl.var @a3d, : !hl.lvalue>>> +// CHECK: hl.var @a3d, : !hl.lvalue>>> float a3d[2][4][3];