Print section flags ok on platforms, which use '@' as comment string. Fix test.
authorAnton Korobeynikov <asl@math.spbu.ru>
Thu, 7 Aug 2008 09:55:06 +0000 (09:55 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Thu, 7 Aug 2008 09:55:06 +0000 (09:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54460 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ELFTargetAsmInfo.cpp
test/CodeGen/ARM/section.ll

index 19e5b011945acd53de254cbb4d70cefac0aaf974..82ac847e845fcb9e9d4f54ee35b202b77eb37878 100644 (file)
@@ -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);
index 0397bcc36e6277f335d2420a0a9a8361a2d242b1..aa658451675bc26e6b2abf2819d90395532eb555 100644 (file)
@@ -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]