Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / dllimport-unique-external.cpp
blob8c0d5d37dfe8f423937770f4979c3e5d3c765445
1 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple i686-windows-msvc -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -disable-llvm-passes -o - %s | FileCheck --check-prefix=MSC %s
2 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple x86_64-scei-ps4 -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s | FileCheck --check-prefix=PS %s
3 // RUN: %clang_cc1 -no-enable-noundef-analysis -triple x86_64-sie-ps5 -emit-llvm -std=c++1y -fno-threadsafe-statics -fms-extensions -O0 -o - %s | FileCheck --check-prefix=PS %s
5 template <typename T> struct __declspec(dllimport) ImportedClassTemplate { void func(); };
7 // Make sure that we do not import classes with unique external linkage.
8 // Note that MSVC does indeed expect the called function to be defined elsewhere.
9 void func1() {
10 class LocalCRTP : public ImportedClassTemplate<LocalCRTP> {};
11 LocalCRTP lc;
12 lc.func();
15 namespace {
16 class AnonNSCRTP : public ImportedClassTemplate<AnonNSCRTP> {};
17 AnonNSCRTP ac;
20 void func2() {
21 ac.func();
24 // MSC-NOT: declare {{.*}}dllimport
25 // MSC: call {{.*}}@"?func@?$ImportedClassTemplate@VLocalCRTP@?1??func1{{.*}}"
26 // MSC-NOT: declare {{.*}}dllimport
27 // MSC: call {{.*}}@"?func@?$ImportedClassTemplate@VAnonNSCRTP@?{{.*}}"
28 // MSC-NOT: declare {{.*}}dllimport
30 // PS-NOT: declare {{.*}}dllimport
31 // PS: call {{.*}}@_ZN21ImportedClassTemplateIZ5func1vE9LocalCRTPE4funcEv
32 // PS-NOT: declare {{.*}}dllimport
33 // PS: call {{.*}}@_ZN21ImportedClassTemplateIN12_GLOBAL__N_110AnonNSCRTPEE4funcEv
34 // PS-NOT: declare {{.*}}dllimport