diff --git a/clang/lib/AST/Mangle.cpp b/clang/lib/AST/Mangle.cpp index fba2808c08a2fb3389cb6689dae3d87dce7bbce0..6d4d296d9593fb6ed4dc1b85b1249ff16c2e9b9a 100644 --- a/clang/lib/AST/Mangle.cpp +++ b/clang/lib/AST/Mangle.cpp @@ -133,8 +133,10 @@ bool MangleContext::shouldMangleDeclName(const NamedDecl *D) { // In BSC, generic function always does mangling. if (getASTContext().getLangOpts().BSC) { if (auto FD = dyn_cast(D)) { - return FD->getTemplatedKind() == - FunctionDecl::TemplatedKind::TK_FunctionTemplateSpecialization; + if (FD->getTemplatedKind() == + FunctionDecl::TemplatedKind::TK_FunctionTemplateSpecialization) { + return true; + } } } #endif diff --git a/clang/test/BSC/Positive/Others/asm_function/asm_function.cbs b/clang/test/BSC/Positive/Others/asm_function/asm_function.cbs new file mode 100644 index 0000000000000000000000000000000000000000..f6767918330049f80d86df9ee1ec4cd879ef37ec --- /dev/null +++ b/clang/test/BSC/Positive/Others/asm_function/asm_function.cbs @@ -0,0 +1,8 @@ +// RUN: %clang %s %S/test.s -o %t.output + +int asmfunction1() asm ("_asmfunction1"); + +int main(){ + asmfunction1(); + return 0; +} diff --git a/clang/test/BSC/Positive/Others/asm_function/test.s b/clang/test/BSC/Positive/Others/asm_function/test.s new file mode 100644 index 0000000000000000000000000000000000000000..c5d4a88f0ed6532be139f8724e0451fea942c2fc --- /dev/null +++ b/clang/test/BSC/Positive/Others/asm_function/test.s @@ -0,0 +1,6 @@ +.section .text +.align 8 +.global _asmfunction1 +.type _asmfunction1, @function + +_asmfunction1: