summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-08-07 09:55:06 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-08-07 09:55:06 +0000
commit9dbbd7506869a0dd0516b1d6e83a6696fa8f83c1 (patch)
treeb44ead19dbcb147d0193fc53d180439c4ad01c35 /llvm
parent1c2de108619628dd57c00cc753d604a27fc2eea0 (diff)
downloadbcm5719-llvm-9dbbd7506869a0dd0516b1d6e83a6696fa8f83c1.tar.gz
bcm5719-llvm-9dbbd7506869a0dd0516b1d6e83a6696fa8f83c1.zip
Print section flags ok on platforms, which use '@' as comment string. Fix test.
llvm-svn: 54460
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/ELFTargetAsmInfo.cpp12
-rw-r--r--llvm/test/CodeGen/ARM/section.ll2
2 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp
index 19e5b011945..82ac847e845 100644
--- a/llvm/lib/Target/ELFTargetAsmInfo.cpp
+++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp
@@ -166,13 +166,19 @@ std::string ELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const {
if (flags & SectionFlags::Small)
Flags += 's';
- Flags += "\"";
+ Flags += "\",";
+
+ // If comment string is '@', e.g. as on ARM - use '%' instead
+ if (strcmp(CommentString, "@") == 0)
+ Flags += '%';
+ else
+ Flags += '@';
// FIXME: There can be exceptions here
if (flags & SectionFlags::BSS)
- Flags += ",@nobits";
+ Flags += "nobits";
else
- Flags += ",@progbits";
+ Flags += "progbits";
if (unsigned entitySize = SectionFlags::getEntitySize(flags))
Flags += "," + utostr(entitySize);
diff --git a/llvm/test/CodeGen/ARM/section.ll b/llvm/test/CodeGen/ARM/section.ll
index 0397bcc36e6..aa658451675 100644
--- a/llvm/test/CodeGen/ARM/section.ll
+++ b/llvm/test/CodeGen/ARM/section.ll
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -mtriple=arm-linux | \
; RUN: grep {__DTOR_END__:}
; RUN: llvm-as < %s | llc -mtriple=arm-linux | \
-; RUN: grep {.section .dtors,"aw",.progbits}
+; RUN: grep {\\.section.\\.dtors,"aw",.progbits}
@__DTOR_END__ = internal global [1 x i32] zeroinitializer, section ".dtors" ; <[1 x i32]*> [#uses=0]
OpenPOWER on IntegriCloud