From adfb3897084768d102504f43517d470285a150da Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 17 Dec 2015 20:50:45 +0000 Subject: [PATCH] [WebAssembly] Switch WebAssemblyMCAsmInfo.h from MCAsmInfo to MCAsmInfoELF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255925 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.h | 4 ++-- test/CodeGen/WebAssembly/global.ll | 10 ++++++++++ test/CodeGen/WebAssembly/ident.ll | 12 ++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 test/CodeGen/WebAssembly/ident.ll diff --git a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.h b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.h index d2b8fb7748f..2dcf2cd3c89 100644 --- a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.h +++ b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.h @@ -15,13 +15,13 @@ #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; diff --git a/test/CodeGen/WebAssembly/global.ll b/test/CodeGen/WebAssembly/global.ll index 32a5e5c606c..5f149ed067c 100644 --- a/test/CodeGen/WebAssembly/global.ll +++ b/test/CodeGen/WebAssembly/global.ll @@ -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 index 00000000000..1e0dc2aa672 --- /dev/null +++ b/test/CodeGen/WebAssembly/ident.ll @@ -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"} -- 2.34.1