[llvm-commits] [llvm] r133166 - /llvm/trunk/test/Assembler/named-metadata.ll

Nick Lewycky nicholas at mxc.ca
Thu Jun 16 10:14:38 PDT 2011


Author: nicholas
Date: Thu Jun 16 12:14:38 2011
New Revision: 133166

URL: http://llvm.org/viewvc/llvm-project?rev=133166&view=rev
Log:
Add testcase for r133050 which added support for printing and parsing escaped
names for named metadata nodes.

Added:
    llvm/trunk/test/Assembler/named-metadata.ll

Added: llvm/trunk/test/Assembler/named-metadata.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/named-metadata.ll?rev=133166&view=auto
==============================================================================
--- llvm/trunk/test/Assembler/named-metadata.ll (added)
+++ llvm/trunk/test/Assembler/named-metadata.ll Thu Jun 16 12:14:38 2011
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+
+!0 = metadata !{metadata !"zero"}
+!1 = metadata !{metadata !"one"}
+!2 = metadata !{metadata !"two"}
+
+!foo = !{!0, !1, !2}
+; CHECK: !foo = !{!0, !1, !2}
+
+!\23pragma = !{!0, !1, !2}
+; CHECK: !\23pragma = !{!0, !1, !2}
+
+; \31 is the digit '1'. On emission, we escape the first character (to avoid
+; conflicting with anonymous metadata), but not the subsequent ones.
+!\31\31\31 = !{!0, !1, !2}
+; CHECK: !\3111 = !{!0, !1, !2}
+
+!\22name\22 = !{!0, !1, !2}
+; CHECK: !\22name\22 = !{!0, !1, !2}
+
+; \x doesn't mean anything, so we parse it literally but escape the \ into \5C
+; when emitting it, followed by xfoo.
+!\xfoo = !{!0, !1, !2}
+; CHECK: !\5Cxfoo = !{!0, !1, !2}





More information about the llvm-commits mailing list