Test basic SEH directive-parsing functionality. Fix a latent bug exposed by
authorCharles Davis <cdavis@mines.edu>
Tue, 24 May 2011 21:22:53 +0000 (21:22 +0000)
committerCharles Davis <cdavis@mines.edu>
Tue, 24 May 2011 21:22:53 +0000 (21:22 +0000)
this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132004 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCStreamer.cpp
test/MC/AsmParser/directive_seh.s [new file with mode: 0644]

index 1402033d41da3067f39abfb788f334352759f59d..19aeaafc722cfc77863a7aad1c810e64e956eeb9 100644 (file)
@@ -21,7 +21,8 @@
 using namespace llvm;
 
 MCStreamer::MCStreamer(MCContext &Ctx) : Context(Ctx), EmitEHFrame(true),
-                                         EmitDebugFrame(false) {
+                                         EmitDebugFrame(false),
+                                         CurrentW64UnwindInfo(0) {
   const MCSection *section = NULL;
   SectionStack.push_back(std::make_pair(section, section));
 }
diff --git a/test/MC/AsmParser/directive_seh.s b/test/MC/AsmParser/directive_seh.s
new file mode 100644 (file)
index 0000000..5fd2efa
--- /dev/null
@@ -0,0 +1,18 @@
+# RUN: llvm-mc -triple x86_64-pc-win32 %s | FileCheck %s
+
+# CHECK: .seh_proc func
+# CHECK: .seh_stackalloc 8
+# CHECK: .seh_endprologue
+# CHECK: .seh_endproc
+
+    .text
+    .globl func
+    .def func; .scl 2; .type 32; .endef
+    .seh_proc func
+func:
+    subq $8, %rsp
+    .seh_stackalloc 8
+    .seh_endprologue
+    addq $8, %rsp
+    ret
+    .seh_endproc