From 8d06ffca9b72ebef7f5b8830b7ccbd9dd74f8e18 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 17 Mar 2011 16:25:24 +0000 Subject: [PATCH] MC/Mach-O: Fix regression introduced in r126127, this assignment shouldn't have been removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127812 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCParser/DarwinAsmParser.cpp | 3 ++- test/MC/MachO/section-attributes.s | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/MC/MachO/section-attributes.s diff --git a/lib/MC/MCParser/DarwinAsmParser.cpp b/lib/MC/MCParser/DarwinAsmParser.cpp index e1f49c2609d..f01f866846d 100644 --- a/lib/MC/MCParser/DarwinAsmParser.cpp +++ b/lib/MC/MCParser/DarwinAsmParser.cpp @@ -434,7 +434,8 @@ bool DarwinAsmParser::ParseDirectiveSection(StringRef, SMLoc) { StringRef Segment, Section; - unsigned TAA, StubSize; + unsigned StubSize; + unsigned TAA = 0; std::string ErrorStr = MCSectionMachO::ParseSectionSpecifier(SectionSpec, Segment, Section, TAA, StubSize); diff --git a/test/MC/MachO/section-attributes.s b/test/MC/MachO/section-attributes.s new file mode 100644 index 00000000000..b21ef38ac56 --- /dev/null +++ b/test/MC/MachO/section-attributes.s @@ -0,0 +1,7 @@ +// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o %t +// RUN: macho-dump %t | FileCheck %s + +// CHECK: # Section 1 +// CHECK: ('flags', 0x0) +.section __TEXT,__objc_opt_ro +.long 0 -- 2.34.1