Bug 8765: Honor assembler labels for builtins. Ensure that the label is
mangled to avoid doing it twice for platforms that use prefixes like
Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131311 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/asm-label.c b/test/CodeGen/asm-label.c
new file mode 100644
index 0000000..7be2ad3
--- /dev/null
+++ b/test/CodeGen/asm-label.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple=i686-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=LINUX
+// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm %s -o - | FileCheck %s --check-prefix=DARWIN
+
+char *strerror(int) asm("alias");
+
+void test(void)
+{
+	strerror(-1);
+}
+
+// LINUX: declare i8* @alias(i32)
+// DARWIN: declare i8* @"\01alias"(i32)