Fangrui Song f972e4d343 [MC,ELF] .section: unconditionally print section flag 'G' after 'o'
* Placing 'G' before 'M' (SHF_MERGE) can be misleading as the sh_entsize
  argument goes before the section group name, if a reader doesn't know
  that the order of extra arguments is not affected by the order of flags.
* 'a', 'w', and 'x' indicate basic permission-related flags. Separating
  them with 'G' is kinda ugly.

Simplify code and move 'G' after 'o'. The new output is more similar to
GCC.
2024-01-09 10:48:23 -08:00

20 lines
465 B
LLVM

; Checks that comdat with nodeduplicate kind is lowered to a zero-flag ELF
; section group.
; RUN: llc < %s -mtriple=x86_64-unknown-linux | FileCheck %s
; CHECK: .section .text.f1,"axG",@progbits,f1{{$}}
; CHECK: .section .text.f2,"axG",@progbits,f1{{$}}
; CHECK: .section .bss.g1,"awG",@nobits,f1{{$}}
$f1 = comdat nodeduplicate
define void @f1() comdat {
unreachable
}
define hidden void @f2() comdat($f1) {
unreachable
}
@g1 = global i32 0, comdat($f1)