Skip to content

Commit a112e7b

Browse files
committed
Also test relocations
1 parent 4e12b6c commit a112e7b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "SystemZHLASMAsmStreamer.h"
1010
#include "llvm/ADT/StringExtras.h"
1111
#include "llvm/BinaryFormat/GOFF.h"
12+
#include "llvm/MC/MCExpr.h"
1213
#include "llvm/MC/MCGOFFAttributes.h"
1314
#include "llvm/MC/MCGOFFStreamer.h"
1415
#include "llvm/MC/MCSymbolGOFF.h"
@@ -80,6 +81,7 @@ void SystemZHLASMAsmStreamer::changeSection(MCSection *Section,
8081
MAI->printSwitchToSection(*Section, Subsection,
8182
getContext().getTargetTriple(), OS);
8283
MCStreamer::changeSection(Section, Subsection);
84+
EmitEOL();
8385
}
8486

8587
void SystemZHLASMAsmStreamer::emitAlignmentDS(uint64_t ByteAlignment,
@@ -332,6 +334,7 @@ void SystemZHLASMAsmStreamer::emitHLASMValueImpl(const MCExpr *Value,
332334
MAI->printExpr(OS, *Value);
333335
return;
334336
default:
337+
Parens &= isa<MCSymbolRefExpr>(Value);
335338
if (Parens)
336339
OS << "A(";
337340
MAI->printExpr(OS, *Value);

llvm/test/CodeGen/SystemZ/zos-hlasm-out.ll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ define void @foo() {
4242
; CHECK: DS 0B
4343
; CHECK-LABEL: L#.str.1 DS 0H
4444
; CHECK: DC XL6'576F726C6400'
45+
; CHECK: C_WSA64 CATTR ALIGN(4),FILL(0),DEFLOAD,NOTEXECUTABLE,RMODE(64),PART(stdi
46+
; CHECK: in#S)
47+
; CHECK: stdin#S XATTR LINKAGE(XPLINK),REFERENCE(DATA),SCOPE(SECTION)
48+
; CHECK: * Offset 0 pointer to data symbol Greeting
49+
; CHECK: DC A(Greeting)
50+
; CHECK: * Offset 8 function descriptor of outs
51+
; CHECK: DC R(outs)
52+
; CHECK: DC V(outs)
4553
; CHECK: END
4654
entry:
4755
%0 = load ptr, ptr @Greeting, align 8

0 commit comments

Comments
 (0)