From c7daeb3098f58028ffe1fc495cb4c51b4d378f9d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 25 Nov 2013 16:06:04 +0000 Subject: Fix .comm and .lcomm on COFF. These should not use COMDATs. GNU as uses .bss for .lcomm and section 0 for .comm. Given static int a; int b; MSVC puts both in .bss. This patch then puts both .comm and .lcomm on .bss. With this change we agree with gas on .lcomm, are much closer on .comm and clang-cl matches msvc on the above example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195654 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/COFF/comm.s | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/MC/COFF/comm.s (limited to 'test') diff --git a/test/MC/COFF/comm.s b/test/MC/COFF/comm.s new file mode 100644 index 0000000000..21ae5d25dd --- /dev/null +++ b/test/MC/COFF/comm.s @@ -0,0 +1,25 @@ +// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -t | FileCheck %s + +.lcomm _a,4,4 +.comm _b, 4, 2 + + +// CHECK: Symbol { +// CHECK: Name: _a +// CHECK-NEXT: Value: +// CHECK-NEXT: Section: .bss +// CHECK-NEXT: BaseType: Null +// CHECK-NEXT: ComplexType: Null +// CHECK-NEXT: StorageClass: Static +// CHECK-NEXT: AuxSymbolCount: 0 +// CHECK-NEXT: } + +// CHECK: Symbol { +// CHECK: Name: _b +// CHECK-NEXT: Value: 4 +// CHECK-NEXT: Section: .bss +// CHECK-NEXT: BaseType: Null +// CHECK-NEXT: ComplexType: Null +// CHECK-NEXT: StorageClass: External +// CHECK-NEXT: AuxSymbolCount: 0 +// CHECK-NEXT: } -- cgit v1.2.3