Commit 58eea4d1 by Jan Voung

Move lowerGlobal() from target-specific code to emitGlobal() in generic code.

Emitting the global initializers is mostly the same across each architecture (same filling, alignment, etc.). The only difference is in assembler-directive quirks. E.g., on ARM for ".align N" N is the exponent for a power of 2, while on x86 N is the actual number of bytes. To avoid target-specific directives, use .p2align which is always a power of 2. Similarly, use % instead of @. Either one may be a comment character for *some* architecture, but for the architectures we care about % is not a comment character while @ is sometimes (ARM). Usually MIPS uses ".space N" for ".zero", but the assembler seems to accept ".zero" so don't change that for now. May need to adjust .long in the future too. .word for AArch64 and .4byte for MIPS? Potentially we can refactor the lowerGlobals() dispatcher (ELF vs ASM vs IASM). The only thing target-specific about that is *probably* just the relocation type. BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1188603002.
parent 0f86d03c
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "assembler_mips32.h" #include "assembler_mips32.h"
#include "IceCfg.h" // setError() #include "IceCfg.h" // setError()
#include "IceCfgNode.h" #include "IceCfgNode.h"
#include "IceGlobalInits.h"
#include "IceOperand.h" #include "IceOperand.h"
#include "IceRegAlloc.h" #include "IceRegAlloc.h"
#include "IceTargetLowering.h" #include "IceTargetLowering.h"
...@@ -445,6 +446,89 @@ TargetDataLowering::createLowering(GlobalContext *Ctx) { ...@@ -445,6 +446,89 @@ TargetDataLowering::createLowering(GlobalContext *Ctx) {
TargetDataLowering::~TargetDataLowering() {} TargetDataLowering::~TargetDataLowering() {}
void TargetDataLowering::emitGlobal(const VariableDeclaration &Var) {
if (!ALLOW_DUMP)
return;
// If external and not initialized, this must be a cross test.
// Don't generate a declaration for such cases.
bool IsExternal = Var.isExternal() || Ctx->getFlags().getDisableInternal();
if (IsExternal && !Var.hasInitializer())
return;
Ostream &Str = Ctx->getStrEmit();
const VariableDeclaration::InitializerListType &Initializers =
Var.getInitializers();
bool HasNonzeroInitializer = Var.hasNonzeroInitializer();
bool IsConstant = Var.getIsConstant();
uint32_t Align = Var.getAlignment();
SizeT Size = Var.getNumBytes();
IceString MangledName = Var.mangleName(Ctx);
IceString SectionSuffix = "";
if (Ctx->getFlags().getDataSections())
SectionSuffix = "." + MangledName;
Str << "\t.type\t" << MangledName << ",%object\n";
if (IsConstant)
Str << "\t.section\t.rodata" << SectionSuffix << ",\"a\",%progbits\n";
else if (HasNonzeroInitializer)
Str << "\t.section\t.data" << SectionSuffix << ",\"aw\",%progbits\n";
else
Str << "\t.section\t.bss" << SectionSuffix << ",\"aw\",%nobits\n";
if (IsExternal)
Str << "\t.globl\t" << MangledName << "\n";
if (Align > 1) {
assert(llvm::isPowerOf2_32(Align));
// Use the .p2align directive, since the .align N directive can either
// interpret N as bytes, or power of 2 bytes, depending on the target.
Str << "\t.p2align\t" << llvm::Log2_32(Align) << "\n";
}
Str << MangledName << ":\n";
if (HasNonzeroInitializer) {
for (VariableDeclaration::Initializer *Init : Initializers) {
switch (Init->getKind()) {
case VariableDeclaration::Initializer::DataInitializerKind: {
const auto Data = llvm::cast<VariableDeclaration::DataInitializer>(Init)
->getContents();
for (SizeT i = 0; i < Init->getNumBytes(); ++i) {
Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
}
break;
}
case VariableDeclaration::Initializer::ZeroInitializerKind:
Str << "\t.zero\t" << Init->getNumBytes() << "\n";
break;
case VariableDeclaration::Initializer::RelocInitializerKind: {
const auto Reloc =
llvm::cast<VariableDeclaration::RelocInitializer>(Init);
Str << "\t" << getEmit32Directive() << "\t";
Str << Reloc->getDeclaration()->mangleName(Ctx);
if (RelocOffsetT Offset = Reloc->getOffset()) {
if (Offset >= 0 || (Offset == INT32_MIN))
Str << " + " << Offset;
else
Str << " - " << -Offset;
}
Str << "\n";
break;
}
}
}
} else
// NOTE: for non-constant zero initializers, this is BSS (no bits),
// so an ELF writer would not write to the file, and only track
// virtual offsets, but the .s writer still needs this .zero and
// cannot simply use the .size to advance offsets.
Str << "\t.zero\t" << Size << "\n";
Str << "\t.size\t" << MangledName << ", " << Size << "\n";
}
std::unique_ptr<TargetHeaderLowering> std::unique_ptr<TargetHeaderLowering>
TargetHeaderLowering::createLowering(GlobalContext *Ctx) { TargetHeaderLowering::createLowering(GlobalContext *Ctx) {
TargetArch Target = Ctx->getFlags().getTargetArch(); TargetArch Target = Ctx->getFlags().getTargetArch();
......
...@@ -384,6 +384,13 @@ public: ...@@ -384,6 +384,13 @@ public:
virtual void lowerConstants() = 0; virtual void lowerConstants() = 0;
protected: protected:
void emitGlobal(const VariableDeclaration &Var);
// For now, we assume .long is the right directive for emitting 4 byte
// emit global relocations. However, LLVM MIPS usually uses .4byte instead.
// Perhaps there is some difference when the location is unaligned.
const char *getEmit32Directive() { return ".long"; }
explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
GlobalContext *Ctx; GlobalContext *Ctx;
}; };
......
...@@ -2194,11 +2194,6 @@ void TargetARM32::emit(const ConstantUndef *) const { ...@@ -2194,11 +2194,6 @@ void TargetARM32::emit(const ConstantUndef *) const {
TargetDataARM32::TargetDataARM32(GlobalContext *Ctx) TargetDataARM32::TargetDataARM32(GlobalContext *Ctx)
: TargetDataLowering(Ctx) {} : TargetDataLowering(Ctx) {}
void TargetDataARM32::lowerGlobal(const VariableDeclaration &Var) const {
(void)Var;
UnimplementedError(Ctx->getFlags());
}
void TargetDataARM32::lowerGlobals( void TargetDataARM32::lowerGlobals(
std::unique_ptr<VariableDeclarationList> Vars) { std::unique_ptr<VariableDeclarationList> Vars) {
switch (Ctx->getFlags().getOutFileType()) { switch (Ctx->getFlags().getOutFileType()) {
...@@ -2212,7 +2207,7 @@ void TargetDataARM32::lowerGlobals( ...@@ -2212,7 +2207,7 @@ void TargetDataARM32::lowerGlobals(
OstreamLocker L(Ctx); OstreamLocker L(Ctx);
for (const VariableDeclaration *Var : *Vars) { for (const VariableDeclaration *Var : *Vars) {
if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) { if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) {
lowerGlobal(*Var); emitGlobal(*Var);
} }
} }
} break; } break;
......
...@@ -319,7 +319,6 @@ protected: ...@@ -319,7 +319,6 @@ protected:
explicit TargetDataARM32(GlobalContext *Ctx); explicit TargetDataARM32(GlobalContext *Ctx);
private: private:
void lowerGlobal(const VariableDeclaration &Var) const;
~TargetDataARM32() override {} ~TargetDataARM32() override {}
template <typename T> static void emitConstantPool(GlobalContext *Ctx); template <typename T> static void emitConstantPool(GlobalContext *Ctx);
}; };
......
...@@ -671,11 +671,6 @@ void ConstantUndef::emit(GlobalContext *) const { ...@@ -671,11 +671,6 @@ void ConstantUndef::emit(GlobalContext *) const {
TargetDataMIPS32::TargetDataMIPS32(GlobalContext *Ctx) TargetDataMIPS32::TargetDataMIPS32(GlobalContext *Ctx)
: TargetDataLowering(Ctx) {} : TargetDataLowering(Ctx) {}
void TargetDataMIPS32::lowerGlobal(const VariableDeclaration &Var) const {
(void)Var;
llvm::report_fatal_error("Not yet implemented");
}
void TargetDataMIPS32::lowerGlobals( void TargetDataMIPS32::lowerGlobals(
std::unique_ptr<VariableDeclarationList> Vars) { std::unique_ptr<VariableDeclarationList> Vars) {
switch (Ctx->getFlags().getOutFileType()) { switch (Ctx->getFlags().getOutFileType()) {
...@@ -689,7 +684,7 @@ void TargetDataMIPS32::lowerGlobals( ...@@ -689,7 +684,7 @@ void TargetDataMIPS32::lowerGlobals(
OstreamLocker L(Ctx); OstreamLocker L(Ctx);
for (const VariableDeclaration *Var : *Vars) { for (const VariableDeclaration *Var : *Vars) {
if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) { if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) {
lowerGlobal(*Var); emitGlobal(*Var);
} }
} }
} break; } break;
......
...@@ -144,7 +144,6 @@ protected: ...@@ -144,7 +144,6 @@ protected:
explicit TargetDataMIPS32(GlobalContext *Ctx); explicit TargetDataMIPS32(GlobalContext *Ctx);
private: private:
void lowerGlobal(const VariableDeclaration &Var) const;
~TargetDataMIPS32() override {} ~TargetDataMIPS32() override {}
template <typename T> static void emitConstantPool(GlobalContext *Ctx); template <typename T> static void emitConstantPool(GlobalContext *Ctx);
}; };
......
...@@ -5017,82 +5017,6 @@ void TargetX8632::emit(const ConstantUndef *) const { ...@@ -5017,82 +5017,6 @@ void TargetX8632::emit(const ConstantUndef *) const {
TargetDataX8632::TargetDataX8632(GlobalContext *Ctx) TargetDataX8632::TargetDataX8632(GlobalContext *Ctx)
: TargetDataLowering(Ctx) {} : TargetDataLowering(Ctx) {}
void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) {
// If external and not initialized, this must be a cross test.
// Don't generate a declaration for such cases.
bool IsExternal = Var.isExternal() || Ctx->getFlags().getDisableInternal();
if (IsExternal && !Var.hasInitializer())
return;
Ostream &Str = Ctx->getStrEmit();
const VariableDeclaration::InitializerListType &Initializers =
Var.getInitializers();
bool HasNonzeroInitializer = Var.hasNonzeroInitializer();
bool IsConstant = Var.getIsConstant();
uint32_t Align = Var.getAlignment();
SizeT Size = Var.getNumBytes();
IceString MangledName = Var.mangleName(Ctx);
IceString SectionSuffix = "";
if (Ctx->getFlags().getDataSections())
SectionSuffix = "." + MangledName;
Str << "\t.type\t" << MangledName << ",@object\n";
if (IsConstant)
Str << "\t.section\t.rodata" << SectionSuffix << ",\"a\",@progbits\n";
else if (HasNonzeroInitializer)
Str << "\t.section\t.data" << SectionSuffix << ",\"aw\",@progbits\n";
else
Str << "\t.section\t.bss" << SectionSuffix << ",\"aw\",@nobits\n";
if (IsExternal)
Str << "\t.globl\t" << MangledName << "\n";
if (Align > 1)
Str << "\t.align\t" << Align << "\n";
Str << MangledName << ":\n";
if (HasNonzeroInitializer) {
for (VariableDeclaration::Initializer *Init : Initializers) {
switch (Init->getKind()) {
case VariableDeclaration::Initializer::DataInitializerKind: {
const auto Data = llvm::cast<VariableDeclaration::DataInitializer>(Init)
->getContents();
for (SizeT i = 0; i < Init->getNumBytes(); ++i) {
Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
}
break;
}
case VariableDeclaration::Initializer::ZeroInitializerKind:
Str << "\t.zero\t" << Init->getNumBytes() << "\n";
break;
case VariableDeclaration::Initializer::RelocInitializerKind: {
const auto Reloc =
llvm::cast<VariableDeclaration::RelocInitializer>(Init);
Str << "\t.long\t";
Str << Reloc->getDeclaration()->mangleName(Ctx);
if (RelocOffsetT Offset = Reloc->getOffset()) {
if (Offset >= 0 || (Offset == INT32_MIN))
Str << " + " << Offset;
else
Str << " - " << -Offset;
}
Str << "\n";
break;
}
}
}
} else
// NOTE: for non-constant zero initializers, this is BSS (no bits),
// so an ELF writer would not write to the file, and only track
// virtual offsets, but the .s writer still needs this .zero and
// cannot simply use the .size to advance offsets.
Str << "\t.zero\t" << Size << "\n";
Str << "\t.size\t" << MangledName << ", " << Size << "\n";
}
void TargetDataX8632::lowerGlobals( void TargetDataX8632::lowerGlobals(
std::unique_ptr<VariableDeclarationList> Vars) { std::unique_ptr<VariableDeclarationList> Vars) {
switch (Ctx->getFlags().getOutFileType()) { switch (Ctx->getFlags().getOutFileType()) {
...@@ -5106,7 +5030,7 @@ void TargetDataX8632::lowerGlobals( ...@@ -5106,7 +5030,7 @@ void TargetDataX8632::lowerGlobals(
OstreamLocker L(Ctx); OstreamLocker L(Ctx);
for (const VariableDeclaration *Var : *Vars) { for (const VariableDeclaration *Var : *Vars) {
if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) { if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) {
lowerGlobal(*Var); emitGlobal(*Var);
} }
} }
} break; } break;
......
...@@ -594,7 +594,6 @@ protected: ...@@ -594,7 +594,6 @@ protected:
explicit TargetDataX8632(GlobalContext *Ctx); explicit TargetDataX8632(GlobalContext *Ctx);
private: private:
void lowerGlobal(const VariableDeclaration &Var);
~TargetDataX8632() override {} ~TargetDataX8632() override {}
template <typename T> static void emitConstantPool(GlobalContext *Ctx); template <typename T> static void emitConstantPool(GlobalContext *Ctx);
}; };
......
...@@ -2,16 +2,35 @@ ...@@ -2,16 +2,35 @@
; REQUIRES: allow_dump ; REQUIRES: allow_dump
; Test -filetype=asm to test the lea "hack" until we are fully confident ; Test initializers with -filetype=asm.
; in -filetype=iasm . ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \
; RUN: %p2i -i %s --filetype=asm --args --verbose none | FileCheck %s ; RUN: -i %s --args -O2 | %if --need=target_X8632 --command FileCheck %s
; Test -filetype=iasm and try to cross reference instructions w/ the ; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --target arm32 \
; symbol table. ; RUN: -i %s --args -O2 --skip-unimplemented \
; RUN: %p2i --assemble --disassemble -i %s --args --verbose none \ ; RUN: | %if --need=target_ARM32 --command FileCheck %s
; RUN: | FileCheck --check-prefix=IAS %s
; RUN: %p2i --assemble --disassemble --dis-flags=-t -i %s --args \ ; Test instructions for materializing addresses.
; RUN: --verbose none | FileCheck --check-prefix=SYMTAB %s ; RUN: %if --need=target_X8632 --command %p2i --filetype=asm --target x8632 \
; RUN: -i %s --args -O2 \
; RUN: | %if --need=target_X8632 --command FileCheck %s --check-prefix=X8632
; Test instructions with -filetype=obj and try to cross reference instructions
; w/ the symbol table.
; RUN: %if --need=target_X8632 --command %p2i --assemble --disassemble \
; RUN: --target x8632 -i %s --args --verbose none \
; RUN: | %if --need=target_X8632 --command FileCheck --check-prefix=IAS %s
; RUN: %if --need=target_X8632 --command %p2i --assemble --disassemble \
; RUN: --dis-flags=-t --target x8632 -i %s --args --verbose none \
; RUN: | %if --need=target_X8632 --command FileCheck --check-prefix=SYMTAB %s
; Only checking symtab for ARM for now. TODO(jvoung): Need to lower
; arguments at callsite.
; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --assemble \
; RUN: --disassemble --dis-flags=-t --target arm32 -i %s \
; RUN: --args --verbose none --skip-unimplemented \
; RUN: | %if --need=target_ARM32 --command FileCheck --check-prefix=SYMTAB %s
define internal i32 @main(i32 %argc, i32 %argv) { define internal i32 @main(i32 %argc, i32 %argv) {
entry: entry:
...@@ -31,14 +50,14 @@ entry: ...@@ -31,14 +50,14 @@ entry:
call void @use(i32 %expanded13) call void @use(i32 %expanded13)
ret i32 0 ret i32 0
} }
; CHECK-LABEL: main ; X8632-LABEL: main
; CHECK: movl $PrimitiveInit, ; X8632: movl $PrimitiveInit,
; CHECK: movl $PrimitiveInitConst, ; X8632: movl $PrimitiveInitConst,
; CHECK: movl $PrimitiveInitStatic, ; X8632: movl $PrimitiveInitStatic,
; CHECK: movl $PrimitiveUninit, ; X8632: movl $PrimitiveUninit,
; CHECK: movl $ArrayInit, ; X8632: movl $ArrayInit,
; CHECK: movl $ArrayInitPartial, ; X8632: movl $ArrayInitPartial,
; CHECK: movl $ArrayUninit, ; X8632: movl $ArrayUninit,
; objdump does not indicate what symbol the mov/relocation applies to ; objdump does not indicate what symbol the mov/relocation applies to
; so we grep for "mov {{.*}}, OFFSET, sec", along with ; so we grep for "mov {{.*}}, OFFSET, sec", along with
...@@ -91,73 +110,73 @@ entry: ...@@ -91,73 +110,73 @@ entry:
@PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4 @PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4
; CHECK: .type PrimitiveInit,@object ; CHECK: .type PrimitiveInit,%object
; CHECK-NEXT: .section .data,"aw",@progbits ; CHECK-NEXT: .section .data,"aw",%progbits
; CHECK-NEXT: .align 4 ; CHECK-NEXT: .p2align 2
; CHECK-NEXT: PrimitiveInit: ; CHECK-NEXT: PrimitiveInit:
; CHECK-NEXT: .byte ; CHECK-NEXT: .byte
; CHECK: .size PrimitiveInit, 4 ; CHECK: .size PrimitiveInit, 4
@PrimitiveInitConst = internal constant [4 x i8] c"\0D\00\00\00", align 4 @PrimitiveInitConst = internal constant [4 x i8] c"\0D\00\00\00", align 4
; CHECK: .type PrimitiveInitConst,@object ; CHECK: .type PrimitiveInitConst,%object
; CHECK-NEXT: .section .rodata,"a",@progbits ; CHECK-NEXT: .section .rodata,"a",%progbits
; CHECK-NEXT: .align 4 ; CHECK-NEXT: .p2align 2
; CHECK-NEXT: PrimitiveInitConst: ; CHECK-NEXT: PrimitiveInitConst:
; CHECK-NEXT: .byte ; CHECK-NEXT: .byte
; CHECK: .size PrimitiveInitConst, 4 ; CHECK: .size PrimitiveInitConst, 4
@ArrayInit = internal global [20 x i8] c"\0A\00\00\00\14\00\00\00\1E\00\00\00(\00\00\002\00\00\00", align 4 @ArrayInit = internal global [20 x i8] c"\0A\00\00\00\14\00\00\00\1E\00\00\00(\00\00\002\00\00\00", align 4
; CHECK: .type ArrayInit,@object ; CHECK: .type ArrayInit,%object
; CHECK-NEXT: .section .data,"aw",@progbits ; CHECK-NEXT: .section .data,"aw",%progbits
; CHECK-NEXT: .align 4 ; CHECK-NEXT: .p2align 2
; CHECK-NEXT: ArrayInit: ; CHECK-NEXT: ArrayInit:
; CHECK-NEXT: .byte ; CHECK-NEXT: .byte
; CHECK: .size ArrayInit, 20 ; CHECK: .size ArrayInit, 20
@ArrayInitPartial = internal global [40 x i8] c"<\00\00\00F\00\00\00P\00\00\00Z\00\00\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 4 @ArrayInitPartial = internal global [40 x i8] c"<\00\00\00F\00\00\00P\00\00\00Z\00\00\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 4
; CHECK: .type ArrayInitPartial,@object ; CHECK: .type ArrayInitPartial,%object
; CHECK-NEXT: .section .data,"aw",@progbits ; CHECK-NEXT: .section .data,"aw",%progbits
; CHECK-NEXT: .align 4 ; CHECK-NEXT: .p2align 2
; CHECK-NEXT: ArrayInitPartial: ; CHECK-NEXT: ArrayInitPartial:
; CHECK-NEXT: .byte ; CHECK-NEXT: .byte
; CHECK: .size ArrayInitPartial, 40 ; CHECK: .size ArrayInitPartial, 40
@PrimitiveInitStatic = internal global [4 x i8] zeroinitializer, align 4 @PrimitiveInitStatic = internal global [4 x i8] zeroinitializer, align 4
; CHECK: .type PrimitiveInitStatic,@object ; CHECK: .type PrimitiveInitStatic,%object
; CHECK-NEXT: .section .bss,"aw",@nobits ; CHECK-NEXT: .section .bss,"aw",%nobits
; CHECK-NEXT: .align 4 ; CHECK-NEXT: .p2align 2
; CHECK-NEXT: PrimitiveInitStatic: ; CHECK-NEXT: PrimitiveInitStatic:
; CHECK-NEXT: .zero 4 ; CHECK-NEXT: .zero 4
; CHECK-NEXT: .size PrimitiveInitStatic, 4 ; CHECK-NEXT: .size PrimitiveInitStatic, 4
@PrimitiveUninit = internal global [4 x i8] zeroinitializer, align 4 @PrimitiveUninit = internal global [4 x i8] zeroinitializer, align 4
; CHECK: .type PrimitiveUninit,@object ; CHECK: .type PrimitiveUninit,%object
; CHECK-NEXT: .section .bss,"aw",@nobits ; CHECK-NEXT: .section .bss,"aw",%nobits
; CHECK-NEXT: .align 4 ; CHECK-NEXT: .p2align 2
; CHECK-NEXT: PrimitiveUninit: ; CHECK-NEXT: PrimitiveUninit:
; CHECK-NEXT: .zero 4 ; CHECK-NEXT: .zero 4
; CHECK-NEXT: .size PrimitiveUninit, 4 ; CHECK-NEXT: .size PrimitiveUninit, 4
@ArrayUninit = internal global [20 x i8] zeroinitializer, align 4 @ArrayUninit = internal global [20 x i8] zeroinitializer, align 4
; CHECK: .type ArrayUninit,@object ; CHECK: .type ArrayUninit,%object
; CHECK-NEXT: .section .bss,"aw",@nobits ; CHECK-NEXT: .section .bss,"aw",%nobits
; CHECK-NEXT: .align 4 ; CHECK-NEXT: .p2align 2
; CHECK-NEXT: ArrayUninit: ; CHECK-NEXT: ArrayUninit:
; CHECK-NEXT: .zero 20 ; CHECK-NEXT: .zero 20
; CHECK-NEXT: .size ArrayUninit, 20 ; CHECK-NEXT: .size ArrayUninit, 20
@ArrayUninitConstDouble = internal constant [200 x i8] zeroinitializer, align 8 @ArrayUninitConstDouble = internal constant [200 x i8] zeroinitializer, align 8
; CHECK: .type ArrayUninitConstDouble,@object ; CHECK: .type ArrayUninitConstDouble,%object
; CHECK-NEXT: .section .rodata,"a",@progbits ; CHECK-NEXT: .section .rodata,"a",%progbits
; CHECK-NEXT: .align 8 ; CHECK-NEXT: .p2align 3
; CHECK-NEXT: ArrayUninitConstDouble: ; CHECK-NEXT: ArrayUninitConstDouble:
; CHECK-NEXT: .zero 200 ; CHECK-NEXT: .zero 200
; CHECK-NEXT: .size ArrayUninitConstDouble, 200 ; CHECK-NEXT: .size ArrayUninitConstDouble, 200
@ArrayUninitConstInt = internal constant [20 x i8] zeroinitializer, align 4 @ArrayUninitConstInt = internal constant [20 x i8] zeroinitializer, align 4
; CHECK: .type ArrayUninitConstInt,@object ; CHECK: .type ArrayUninitConstInt,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK-NEXT: .align 4 ; CHECK-NEXT: .p2align 2
; CHECK-NEXT: ArrayUninitConstInt: ; CHECK-NEXT: ArrayUninitConstInt:
; CHECK-NEXT: .zero 20 ; CHECK-NEXT: .zero 20
; CHECK-NEXT: .size ArrayUninitConstInt, 20 ; CHECK-NEXT: .size ArrayUninitConstInt, 20
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
@bytes = internal global [7 x i8] c"abcdefg" @bytes = internal global [7 x i8] c"abcdefg"
; DUMP: @bytes = internal global [7 x i8] c"abcdefg" ; DUMP: @bytes = internal global [7 x i8] c"abcdefg"
; CHECK: .type bytes,@object ; CHECK: .type bytes,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:bytes: ; CHECK:bytes:
; CHECK: .byte 97 ; CHECK: .byte 97
; CHECK: .byte 98 ; CHECK: .byte 98
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
@const_bytes = internal constant [7 x i8] c"abcdefg" @const_bytes = internal constant [7 x i8] c"abcdefg"
; DUMP: @const_bytes = internal constant [7 x i8] c"abcdefg" ; DUMP: @const_bytes = internal constant [7 x i8] c"abcdefg"
; CHECK: .type const_bytes,@object ; CHECK: .type const_bytes,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_bytes: ; CHECK:const_bytes:
; CHECK: .byte 97 ; CHECK: .byte 97
; CHECK: .byte 98 ; CHECK: .byte 98
...@@ -44,40 +44,40 @@ ...@@ -44,40 +44,40 @@
@ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32) @ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32)
; DUMP: @ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32) ; DUMP: @ptr_to_ptr = internal global i32 ptrtoint (i32* @ptr to i32)
; CHECK: .type ptr_to_ptr,@object ; CHECK: .type ptr_to_ptr,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:ptr_to_ptr: ; CHECK:ptr_to_ptr:
; CHECK: .long ptr ; CHECK: .long ptr
; CHECK: .size ptr_to_ptr, 4 ; CHECK: .size ptr_to_ptr, 4
@const_ptr_to_ptr = internal constant i32 ptrtoint (i32* @ptr to i32) @const_ptr_to_ptr = internal constant i32 ptrtoint (i32* @ptr to i32)
; DUMP: @const_ptr_to_ptr = internal constant i32 ptrtoint (i32* @ptr to i32) ; DUMP: @const_ptr_to_ptr = internal constant i32 ptrtoint (i32* @ptr to i32)
; CHECK: .type const_ptr_to_ptr,@object ; CHECK: .type const_ptr_to_ptr,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_ptr_to_ptr: ; CHECK:const_ptr_to_ptr:
; CHECK: .long ptr ; CHECK: .long ptr
; CHECK: .size const_ptr_to_ptr, 4 ; CHECK: .size const_ptr_to_ptr, 4
@ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32) @ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32)
; DUMP: @ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32) ; DUMP: @ptr_to_func = internal global i32 ptrtoint (void ()* @func to i32)
; CHECK: .type ptr_to_func,@object ; CHECK: .type ptr_to_func,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:ptr_to_func: ; CHECK:ptr_to_func:
; CHECK: .long func ; CHECK: .long func
; CHECK: .size ptr_to_func, 4 ; CHECK: .size ptr_to_func, 4
@const_ptr_to_func = internal constant i32 ptrtoint (void ()* @func to i32) @const_ptr_to_func = internal constant i32 ptrtoint (void ()* @func to i32)
; DUMP: @const_ptr_to_func = internal constant i32 ptrtoint (void ()* @func to i32) ; DUMP: @const_ptr_to_func = internal constant i32 ptrtoint (void ()* @func to i32)
; CHECK: .type const_ptr_to_func,@object ; CHECK: .type const_ptr_to_func,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_ptr_to_func: ; CHECK:const_ptr_to_func:
; CHECK: .long func ; CHECK: .long func
; CHECK: .size const_ptr_to_func, 4 ; CHECK: .size const_ptr_to_func, 4
@compound = internal global <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }> @compound = internal global <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
; DUMP: @compound = internal global <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }> ; DUMP: @compound = internal global <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
; CHECK: .type compound,@object ; CHECK: .type compound,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:compound: ; CHECK:compound:
; CHECK: .byte 102 ; CHECK: .byte 102
; CHECK: .byte 111 ; CHECK: .byte 111
...@@ -87,8 +87,8 @@ ...@@ -87,8 +87,8 @@
@const_compound = internal constant <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }> @const_compound = internal constant <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
; DUMP: @const_compound = internal constant <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }> ; DUMP: @const_compound = internal constant <{ [3 x i8], i32 }> <{ [3 x i8] c"foo", i32 ptrtoint (void ()* @func to i32) }>
; CHECK: .type const_compound,@object ; CHECK: .type const_compound,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_compound: ; CHECK:const_compound:
; CHECK: .byte 102 ; CHECK: .byte 102
; CHECK: .byte 111 ; CHECK: .byte 111
...@@ -98,162 +98,162 @@ ...@@ -98,162 +98,162 @@
@ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32) @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32)
; DUMP: @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32) ; DUMP: @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32)
; CHECK: .type ptr,@object ; CHECK: .type ptr,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:ptr: ; CHECK:ptr:
; CHECK: .long bytes ; CHECK: .long bytes
; CHECK: .size ptr, 4 ; CHECK: .size ptr, 4
@const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32) @const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32)
; DUMP: @const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32) ; DUMP: @const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32)
; CHECK: .type const_ptr,@object ; CHECK: .type const_ptr,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_ptr: ; CHECK:const_ptr:
; CHECK: .long bytes ; CHECK: .long bytes
; CHECK: .size const_ptr, 4 ; CHECK: .size const_ptr, 4
@addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1) @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1)
; DUMP: @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1) ; DUMP: @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1)
; CHECK: .type addend_ptr,@object ; CHECK: .type addend_ptr,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:addend_ptr: ; CHECK:addend_ptr:
; CHECK: .long ptr + 1 ; CHECK: .long ptr + 1
; CHECK: .size addend_ptr, 4 ; CHECK: .size addend_ptr, 4
@const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1) @const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1)
; DUMP: @const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1) ; DUMP: @const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 1)
; CHECK: .type const_addend_ptr,@object ; CHECK: .type const_addend_ptr,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_addend_ptr: ; CHECK:const_addend_ptr:
; CHECK: .long ptr + 1 ; CHECK: .long ptr + 1
; CHECK: .size const_addend_ptr, 4 ; CHECK: .size const_addend_ptr, 4
@addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1) @addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1)
; DUMP: @addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1) ; DUMP: @addend_negative = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1)
; CHECK: .type addend_negative,@object ; CHECK: .type addend_negative,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:addend_negative: ; CHECK:addend_negative:
; CHECK: .long ptr - 1 ; CHECK: .long ptr - 1
; CHECK: .size addend_negative, 4 ; CHECK: .size addend_negative, 4
@const_addend_negative = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1) @const_addend_negative = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1)
; DUMP: @const_addend_negative = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1) ; DUMP: @const_addend_negative = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32), i32 -1)
; CHECK: .type const_addend_negative,@object ; CHECK: .type const_addend_negative,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_addend_negative: ; CHECK:const_addend_negative:
; CHECK: .long ptr - 1 ; CHECK: .long ptr - 1
; CHECK: .size const_addend_negative, 4 ; CHECK: .size const_addend_negative, 4
@addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1) @addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1)
; DUMP: @addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1) ; DUMP: @addend_array1 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1)
; CHECK: .type addend_array1,@object ; CHECK: .type addend_array1,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:addend_array1: ; CHECK:addend_array1:
; CHECK: .long bytes + 1 ; CHECK: .long bytes + 1
; CHECK: .size addend_array1, 4 ; CHECK: .size addend_array1, 4
@const_addend_array1 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1) @const_addend_array1 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1)
; DUMP: @const_addend_array1 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1) ; DUMP: @const_addend_array1 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 1)
; CHECK: .type const_addend_array1,@object ; CHECK: .type const_addend_array1,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_addend_array1: ; CHECK:const_addend_array1:
; CHECK: .long bytes + 1 ; CHECK: .long bytes + 1
; CHECK: .size const_addend_array1, 4 ; CHECK: .size const_addend_array1, 4
@addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7) @addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7)
; DUMP: @addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7) ; DUMP: @addend_array2 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7)
; CHECK: .type addend_array2,@object ; CHECK: .type addend_array2,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:addend_array2: ; CHECK:addend_array2:
; CHECK: .long bytes + 7 ; CHECK: .long bytes + 7
; CHECK: .size addend_array2, 4 ; CHECK: .size addend_array2, 4
@const_addend_array2 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7) @const_addend_array2 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7)
; DUMP: @const_addend_array2 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7) ; DUMP: @const_addend_array2 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 7)
; CHECK: .type const_addend_array2,@object ; CHECK: .type const_addend_array2,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_addend_array2: ; CHECK:const_addend_array2:
; CHECK: .long bytes + 7 ; CHECK: .long bytes + 7
; CHECK: .size const_addend_array2, 4 ; CHECK: .size const_addend_array2, 4
@addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9) @addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9)
; DUMP: @addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9) ; DUMP: @addend_array3 = internal global i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9)
; CHECK: .type addend_array3,@object ; CHECK: .type addend_array3,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:addend_array3: ; CHECK:addend_array3:
; CHECK: .long bytes + 9 ; CHECK: .long bytes + 9
; CHECK: .size addend_array3, 4 ; CHECK: .size addend_array3, 4
@const_addend_array3 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9) @const_addend_array3 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9)
; DUMP: @const_addend_array3 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9) ; DUMP: @const_addend_array3 = internal constant i32 add (i32 ptrtoint ([7 x i8]* @bytes to i32), i32 9)
; CHECK: .type const_addend_array3,@object ; CHECK: .type const_addend_array3,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_addend_array3: ; CHECK:const_addend_array3:
; CHECK: .long bytes + 9 ; CHECK: .long bytes + 9
; CHECK: .size const_addend_array3, 4 ; CHECK: .size const_addend_array3, 4
@addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1) @addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1)
; DUMP: @addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1) ; DUMP: @addend_struct1 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1)
; CHECK: .type addend_struct1,@object ; CHECK: .type addend_struct1,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:addend_struct1: ; CHECK:addend_struct1:
; CHECK: .long compound + 1 ; CHECK: .long compound + 1
; CHECK: .size addend_struct1, 4 ; CHECK: .size addend_struct1, 4
@const_addend_struct1 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1) @const_addend_struct1 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1)
; DUMP: @const_addend_struct1 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1) ; DUMP: @const_addend_struct1 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 1)
; CHECK: .type const_addend_struct1,@object ; CHECK: .type const_addend_struct1,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_addend_struct1: ; CHECK:const_addend_struct1:
; CHECK: .long compound + 1 ; CHECK: .long compound + 1
; CHECK: .size const_addend_struct1, 4 ; CHECK: .size const_addend_struct1, 4
@addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4) @addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4)
; DUMP: @addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4) ; DUMP: @addend_struct2 = internal global i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4)
; CHECK: .type addend_struct2,@object ; CHECK: .type addend_struct2,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK:addend_struct2: ; CHECK:addend_struct2:
; CHECK: .long compound + 4 ; CHECK: .long compound + 4
; CHECK: .size addend_struct2, 4 ; CHECK: .size addend_struct2, 4
@const_addend_struct2 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4) @const_addend_struct2 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4)
; DUMP: @const_addend_struct2 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4) ; DUMP: @const_addend_struct2 = internal constant i32 add (i32 ptrtoint (<{ [3 x i8], i32 }>* @compound to i32), i32 4)
; CHECK: .type const_addend_struct2,@object ; CHECK: .type const_addend_struct2,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:const_addend_struct2: ; CHECK:const_addend_struct2:
; CHECK: .long compound + 4 ; CHECK: .long compound + 4
; CHECK: .size const_addend_struct2, 4 ; CHECK: .size const_addend_struct2, 4
@ptr_to_func_align = internal global i32 ptrtoint (void ()* @func to i32), align 8 @ptr_to_func_align = internal global i32 ptrtoint (void ()* @func to i32), align 8
; DUMP: @ptr_to_func_align = internal global i32 ptrtoint (void ()* @func to i32), align 8 ; DUMP: @ptr_to_func_align = internal global i32 ptrtoint (void ()* @func to i32), align 8
; CHECK: .type ptr_to_func_align,@object ; CHECK: .type ptr_to_func_align,%object
; CHECK: .section .data,"aw",@progbits ; CHECK: .section .data,"aw",%progbits
; CHECK: .align 8 ; CHECK: .p2align 3
; CHECK:ptr_to_func_align: ; CHECK:ptr_to_func_align:
; CHECK: .long func ; CHECK: .long func
; CHECK: .size ptr_to_func_align, 4 ; CHECK: .size ptr_to_func_align, 4
@const_ptr_to_func_align = internal constant i32 ptrtoint (void ()* @func to i32), align 8 @const_ptr_to_func_align = internal constant i32 ptrtoint (void ()* @func to i32), align 8
; DUMP: @const_ptr_to_func_align = internal constant i32 ptrtoint (void ()* @func to i32), align 8 ; DUMP: @const_ptr_to_func_align = internal constant i32 ptrtoint (void ()* @func to i32), align 8
; CHECK: .type const_ptr_to_func_align,@object ; CHECK: .type const_ptr_to_func_align,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK: .align 8 ; CHECK: .p2align 3
; CHECK:const_ptr_to_func_align: ; CHECK:const_ptr_to_func_align:
; CHECK: .long func ; CHECK: .long func
; CHECK: .size const_ptr_to_func_align, 4 ; CHECK: .size const_ptr_to_func_align, 4
@char = internal constant [1 x i8] c"0" @char = internal constant [1 x i8] c"0"
; DUMP: @char = internal constant [1 x i8] c"0" ; DUMP: @char = internal constant [1 x i8] c"0"
; CHECK: .type char,@object ; CHECK: .type char,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:char: ; CHECK:char:
; CHECK: .byte 48 ; CHECK: .byte 48
; CHECK: .size char, 1 ; CHECK: .size char, 1
@short = internal constant [2 x i8] zeroinitializer @short = internal constant [2 x i8] zeroinitializer
; DUMP: @short = internal constant [2 x i8] zeroinitializer ; DUMP: @short = internal constant [2 x i8] zeroinitializer
; CHECK: .type short,@object ; CHECK: .type short,%object
; CHECK: .section .rodata,"a",@progbits ; CHECK: .section .rodata,"a",%progbits
; CHECK:short: ; CHECK:short:
; CHECK: .zero 2 ; CHECK: .zero 2
; CHECK: .size short, 2 ; CHECK: .size short, 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment