Skip to content

IR parser accepts missing comma before align in global variable declaration and emits as attribute #133864

Open
@arsenm

Description

@arsenm
; RUN: llvm-as < %s | llvm-dis | FileCheck %s

; CHECK: @code_model_tiny_drop = global i32 0, code_model "tiny" #0
; CHECK: attributes #0 = { align=4 }

@missing_comma_after_code_model = global i32 0, code_model "tiny" align 4

There is a missing comma after the code_model marker, before align. This should probably be rejected. I'm not sure how this ends up getting interpreted, but when printed it looks like it was mishandled. The special align directive on the global declaration is missing, and replaced with an attribute group as if it were treated as an ordinary attribute on a function

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions