Define WeakRefDirective.
authorAkira Hatanaka <ahatanak@gmail.com>
Wed, 25 May 2011 23:30:30 +0000 (23:30 +0000)
committerAkira Hatanaka <ahatanak@gmail.com>
Wed, 25 May 2011 23:30:30 +0000 (23:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132098 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsMCAsmInfo.cpp
test/CodeGen/Mips/weak.ll [new file with mode: 0644]

index fe48ab770e68b6ed50347d1904aef919350a254e..ca00463a98b056afe77cece5bfb60398cbd20d67 100644 (file)
@@ -24,4 +24,5 @@ MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, StringRef TT) {
   ZeroDirective               = "\t.space\t";
   GPRel32Directive            = "\t.gpword\t";
   HasSetDirective             = false;
+  WeakRefDirective            = "\t.weak\t";
 }
diff --git a/test/CodeGen/Mips/weak.ll b/test/CodeGen/Mips/weak.ll
new file mode 100644 (file)
index 0000000..09dd2a4
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: llc -march=mips < %s | FileCheck %s
+
+@t = common global i32 (...)* null, align 4
+
+define void @f() nounwind {
+entry:
+  store i32 (...)* @test_weak, i32 (...)** @t, align 4
+  ret void
+}
+
+; CHECK: .weak test_weak
+declare extern_weak i32 @test_weak(...)