- PR3698.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66038
91177308-0d34-0410-b5e6-
96231b3b80d8
if (D->getAttr<WeakAttr>())
GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage);
+
+ if (const AsmLabelAttr *ALA = D->getAttr<AsmLabelAttr>()) {
+ // Prefaced with special LLVM marker to indicate that the name
+ // should not be munged.
+ GV->setName("\01" + ALA->getLabel());
+ }
}
// Make sure the result is of the correct type.
// RUN: clang -emit-llvm -o %t %s &&
// RUN: grep "@pipe()" %t | count 0 &&
// RUN: grep '_thisIsNotAPipe' %t | count 3 &&
+// RUN: grep 'g0' %t | count 0 &&
+// RUN: grep '_renamed' %t | count 2 &&
// RUN: clang -DUSE_DEF -emit-llvm -o %t %s &&
// RUN: grep "@pipe()" %t | count 0 &&
// RUN: grep '_thisIsNotAPipe' %t | count 3
int x = 10;
}
#endif
+
+// PR3698
+extern int g0 asm("_renamed");
+int f2() {
+ return g0;
+}