Files
clang-p2996/clang/test/CodeGenCXX/dllimport-rtti.cpp
Nikita Popov 532dc62b90 [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
2022-04-07 12:09:47 +02:00

34 lines
1.3 KiB
C++

// RUN: %clang_cc1 -no-opaque-pointers -triple i686-windows-msvc -emit-llvm -std=c++1y -fms-extensions -O1 -disable-llvm-passes -o - %s | FileCheck %s --check-prefix=MSVC
// RUN: %clang_cc1 -no-opaque-pointers -triple i686-windows-gnu -emit-llvm -std=c++1y -fms-extensions -O1 -disable-llvm-passes -o - %s | FileCheck %s --check-prefix=GNU
struct __declspec(dllimport) S {
virtual void f() {}
} s;
// MSVC: [[VF_S:.*]] = private unnamed_addr constant { [2 x i8*] }
// MSVC-DAG: @"??_SS@@6B@" = unnamed_addr alias i8*, getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* [[VF_S]], i32 0, i32 0, i32 1)
// MSVC-DAG: @"??_R0?AUS@@@8" = linkonce_odr
// MSVC-DAG: @"??_R1A@?0A@EA@S@@8" = linkonce_odr
// MSVC-DAG: @"??_R2S@@8" = linkonce_odr
// MSVC-DAG: @"??_R3S@@8" = linkonce_odr
// GNU-DAG: @_ZTV1S = available_externally dllimport
// GNU-DAG: @_ZTI1S = linkonce_odr dso_local
struct U : S {
} u;
struct __declspec(dllimport) V {
virtual void f();
} v;
// GNU-DAG: @_ZTV1V = available_externally dllimport
// GNU-DAG: @_ZTS1V = linkonce_odr dso_local
// GNU-DAG: @_ZTI1V = linkonce_odr dso_local
struct W {
__declspec(dllimport) virtual void f();
virtual void g();
} w;
// GNU-DAG: @_ZTV1W = linkonce_odr dso_local
// GNU-DAG: @_ZTS1W = linkonce_odr dso_local
// GNU-DAG: @_ZTI1W = linkonce_odr dso_local