summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/dllimport.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-09-13 21:08:20 +0000
committerHans Wennborg <hans@hanshq.net>2016-09-13 21:08:20 +0000
commit93f7547260f1e490fd95b68f05f0b69d356ce8be (patch)
treecba5529b87ce1a1cc6f25123ce8627eb8d9871c7 /clang/test/CodeGenCXX/dllimport.cpp
parent1e2e8eae5d0c5fd4fc12477c1137d13502f7da5a (diff)
downloadbcm5719-llvm-93f7547260f1e490fd95b68f05f0b69d356ce8be.tar.gz
bcm5719-llvm-93f7547260f1e490fd95b68f05f0b69d356ce8be.zip
Try harder to not inline dllimport functions referencing non-dllimport functions
In r246338, code was added to check for this, but it failed to take into account implicit destructor invocations because those are not reflected in the AST. This adds a separate check for them. llvm-svn: 281395
Diffstat (limited to 'clang/test/CodeGenCXX/dllimport.cpp')
-rw-r--r--clang/test/CodeGenCXX/dllimport.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/dllimport.cpp b/clang/test/CodeGenCXX/dllimport.cpp
index aff240f2876..1a24e34318a 100644
--- a/clang/test/CodeGenCXX/dllimport.cpp
+++ b/clang/test/CodeGenCXX/dllimport.cpp
@@ -347,6 +347,13 @@ __declspec(dllimport) inline int *ReferencingImportedDelete() { delete (int*)nul
// MO1-DAG: define available_externally dllimport i32* @"\01?ReferencingImportedDelete@@YAPAHXZ"
USE(ReferencingImportedNew)
USE(ReferencingImportedDelete)
+struct ClassWithDtor { ~ClassWithDtor() {} };
+struct __declspec(dllimport) ClassWithNonDllImportField { ClassWithDtor t; };
+struct __declspec(dllimport) ClassWithNonDllImportBase : public ClassWithDtor { };
+USECLASS(ClassWithNonDllImportField);
+USECLASS(ClassWithNonDllImportBase);
+// MO1-DAG: declare dllimport x86_thiscallcc void @"\01??1ClassWithNonDllImportBase@@QAE@XZ"(%struct.ClassWithNonDllImportBase*)
+// MO1-DAG: declare dllimport x86_thiscallcc void @"\01??1ClassWithNonDllImportField@@QAE@XZ"(%struct.ClassWithNonDllImportField*)
// A dllimport function with a TLS variable must not be available_externally.
__declspec(dllimport) inline void FunctionWithTLSVar() { static __thread int x = 42; }
OpenPOWER on IntegriCloud