From 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 24 Nov 2014 09:15:30 +0000 Subject: Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957 --- test/CodeGenCXX/inline-functions.cpp | 58 ++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to 'test/CodeGenCXX/inline-functions.cpp') diff --git a/test/CodeGenCXX/inline-functions.cpp b/test/CodeGenCXX/inline-functions.cpp index 9f8e536a3b0c8..622cfa9536f3d 100644 --- a/test/CodeGenCXX/inline-functions.cpp +++ b/test/CodeGenCXX/inline-functions.cpp @@ -1,11 +1,12 @@ -// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=NORMAL +// RUN: %clang_cc1 %s -std=c++11 -fms-compatibility -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=MSVCCOMPAT // CHECK: ; ModuleID struct A { inline void f(); }; -// CHECK-NOT-LABEL: define void @_ZN1A1fEv +// CHECK-NOT: define void @_ZN1A1fEv void A::f() { } template struct B { }; @@ -67,3 +68,56 @@ namespace test2 { } // CHECK-LABEL: define linkonce_odr void @_ZN5test21fERKNS_1AE } + +// MSVCCOMPAT-LABEL: define weak_odr void @_Z17ExternAndInlineFnv +// NORMAL-NOT: _Z17ExternAndInlineFnv +extern inline void ExternAndInlineFn() {} + +// MSVCCOMPAT-LABEL: define weak_odr void @_Z18InlineThenExternFnv +// NORMAL-NOT: _Z18InlineThenExternFnv +inline void InlineThenExternFn() {} +extern void InlineThenExternFn(); + +// CHECK-LABEL: define void @_Z18ExternThenInlineFnv +extern void ExternThenInlineFn() {} + +// MSVCCOMPAT-LABEL: define weak_odr void @_Z25ExternThenInlineThenDefFnv +// NORMAL-NOT: _Z25ExternThenInlineThenDefFnv +extern void ExternThenInlineThenDefFn(); +inline void ExternThenInlineThenDefFn(); +void ExternThenInlineThenDefFn() {} + +// MSVCCOMPAT-LABEL: define weak_odr void @_Z25InlineThenExternThenDefFnv +// NORMAL-NOT: _Z25InlineThenExternThenDefFnv +inline void InlineThenExternThenDefFn(); +extern void InlineThenExternThenDefFn(); +void InlineThenExternThenDefFn() {} + +// MSVCCOMPAT-LABEL: define weak_odr i32 @_Z20ExternAndConstexprFnv +// NORMAL-NOT: _Z17ExternAndConstexprFnv +extern constexpr int ExternAndConstexprFn() { return 0; } + +// CHECK-NOT: _Z11ConstexprFnv +constexpr int ConstexprFn() { return 0; } + +template +extern inline void ExternInlineOnPrimaryTemplate(T); + +// CHECK-LABEL: define void @_Z29ExternInlineOnPrimaryTemplateIiEvT_ +template <> +void ExternInlineOnPrimaryTemplate(int) {} + +template +extern inline void ExternInlineOnPrimaryTemplateAndSpecialization(T); + +// MSVCCOMPAT-LABEL: define weak_odr void @_Z46ExternInlineOnPrimaryTemplateAndSpecializationIiEvT_ +// NORMAL-NOT: _Z46ExternInlineOnPrimaryTemplateAndSpecializationIiEvT_ +template <> +extern inline void ExternInlineOnPrimaryTemplateAndSpecialization(int) {} + +struct TypeWithInlineMethods { + // CHECK-NOT: _ZN21TypeWithInlineMethods9StaticFunEv + static void StaticFun() {} + // CHECK-NOT: _ZN21TypeWithInlineMethods12NonStaticFunEv + void NonStaticFun() { StaticFun(); } +}; -- cgit v1.3