[WebAssembly] Switch WebAssemblyMCAsmInfo.h from MCAsmInfo to MCAsmInfoELF.
authorDan Gohman <dan433584@gmail.com>
Thu, 17 Dec 2015 20:50:45 +0000 (20:50 +0000)
committerDan Gohman <dan433584@gmail.com>
Thu, 17 Dec 2015 20:50:45 +0000 (20:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255925 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.h
test/CodeGen/WebAssembly/global.ll
test/CodeGen/WebAssembly/ident.ll [new file with mode: 0644]

index d2b8fb7748fce6965ff039e7fadc44b6ef6c093a..2dcf2cd3c892aae2553fc490244f776b025385ad 100644 (file)
 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYMCASMINFO_H
 #define LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYMCASMINFO_H
 
-#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCAsmInfoELF.h"
 
 namespace llvm {
 
 class Triple;
 
-class WebAssemblyMCAsmInfo final : public MCAsmInfo {
+class WebAssemblyMCAsmInfo final : public MCAsmInfoELF {
 public:
   explicit WebAssemblyMCAsmInfo(const Triple &T);
   ~WebAssemblyMCAsmInfo() override;
index 32a5e5c606ca562e80833d39c44260cbd0efd988..5f149ed067c82e1a73bd00583c34fbef73b5844e 100644 (file)
@@ -165,3 +165,13 @@ define i8* @call_memcpy(i8* %p, i8* nocapture readonly %q, i32 %n) {
 ; CHECK-NEXT: .size ptr, 4
 @arr = global [128 x i32] zeroinitializer, align 16
 @ptr = global i32* getelementptr inbounds ([128 x i32], [128 x i32]* @arr, i32 0, i32 20), align 4
+
+; Constant global.
+; CHECK: .type    rom,@object{{$}}
+; CHECK: .section .rodata,"a",@progbits{{$}}
+; CHECK: .globl   rom{{$}}
+; CHECK: .align   4{{$}}
+; CHECK: rom:
+; CHECK: .zero    512{{$}}
+; CHECK: .size    rom, 512{{$}}
+@rom = constant [128 x i32] zeroinitializer, align 16
diff --git a/test/CodeGen/WebAssembly/ident.ll b/test/CodeGen/WebAssembly/ident.ll
new file mode 100644 (file)
index 0000000..1e0dc2a
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: llc < %s -asm-verbose=false | FileCheck %s
+
+; Test llvm.ident.
+
+target datalayout = "e-p:32:32-i64:64-n32:64-S128"
+target triple = "wasm32-unknown-unknown"
+
+; CHECK: .ident "hello world"
+
+!llvm.ident = !{!0}
+
+!0 = !{!"hello world"}