From: Jakub Jelinek Date: Sat, 25 Jan 2020 23:47:18 +0000 (+0100) Subject: testsuite: Fix up pr93166.C test, so that it doesn't FAIL with -std=c++98 and tests... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=05107d4e4ccd11ecc8712d6e271fcb4b5f17060f;p=gcc.git testsuite: Fix up pr93166.C test, so that it doesn't FAIL with -std=c++98 and tests what it is supposed to test. 2020-01-26 Jakub Jelinek PR ipa/93166 * g++.dg/pr93166.C: Move to ... * g++.dg/pr93166_0.C: ... here. Turn it into a proper lto test. --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 49901356e7b..99da3cc5feb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2020-01-26 Jakub Jelinek + PR ipa/93166 + * g++.dg/pr93166.C: Move to ... + * g++.dg/pr93166_0.C: ... here. Turn it into a proper lto test. + PR tree-optimization/92788 * g++.dg/pr92788.C: Move to ... * g++.target/i386/pr92788.C: ... here. Remove target from dg-do line. diff --git a/gcc/testsuite/g++.dg/lto/pr93166_0.C b/gcc/testsuite/g++.dg/lto/pr93166_0.C new file mode 100644 index 00000000000..52f7ddf4016 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr93166_0.C @@ -0,0 +1,213 @@ +// PR ipa/93166 +// { dg-lto-do link } +// { dg-lto-options { { -fPIC -O2 -flto -fvisibility=hidden } } } +// { dg-require-effective-target shared } +// { dg-require-effective-target fpic } +// { dg-extra-ld-options "-shared" } +// { dg-require-visibility "" } + +namespace Qt { +enum DropAction {}; +} +class QObject; +struct QMetaObject { + static void activate(const QMetaObject *, void *); + enum Call {}; + struct { + const QMetaObject *superdata; + int *stringdata; + unsigned *data; + typedef void (*StaticMetacallFunction)(QObject *, Call, int, void **); + StaticMetacallFunction static_metacallrelatedMetaObjectsextradata; + } d; +}; +class QString; +struct QListData { + struct Data; + Data *d; +}; +template class QList { + union { + QListData p; + QListData::Data *d; + }; + +public: + ~QList(); +}; +class QStringList : QList {}; +template struct QScopedPointerDeleter; +class QObjectData; +template > +class QScopedPointer { +public: + ~QScopedPointer(); + QObjectData *d; +}; + +template struct FunctionPointer; +template +struct FunctionPointer { + typedef Obj Object; +}; + +class QObject { +public: + virtual ~QObject(); + virtual void disconnectNotify(); + template + void connect(typename FunctionPointer::Object *, Func1, + typename FunctionPointer::Object *, Func2); + QScopedPointer d_ptr; +}; +class QPaintDevicePrivate; +class QPaintDevice { +public: + virtual ~QPaintDevice(); + unsigned short painters; + QPaintDevicePrivate *reserved; +}; +class QWidgetData; +class QWidget : public QObject, QPaintDevice { + QWidgetData *data; +}; +class QFrame : public QWidget {}; +class QMenu; +class QMimeData; +class QAbstractScrollArea : public QFrame {}; +class QAbstractItemView : public QAbstractScrollArea {}; +class QTreeView : public QAbstractItemView {}; +class QTreeWidgetItem; +class QTreeWidget : public QTreeView {}; +class QSignalMapper; +class KActionCollection; +class MenuFile; +class MenuFolderInfo; +class MenuEntryInfo; +class MenuSeparatorInfo; +class TreeView : QTreeWidget { +public: + static const QMetaObject d; + static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); + void disableAction(); + bool dropMimeData(QTreeWidgetItem *, int, const QMimeData *, Qt::DropAction); + KActionCollection *m_ac; + QMenu *m_popupMenu; + int m_clipboard; + MenuFolderInfo *m_clipboardFolderInfo; + MenuEntryInfo *m_clipboardEntryInfo; + bool m_showHidden; + MenuFile *m_menuFile; + MenuFolderInfo *m_rootFolder; + MenuSeparatorInfo *m_separator; + QStringList m_newMenuIds; + QStringList m_newDirectoryList; + bool m_layoutDirty; + bool m_detailedMenuEntries; + bool m_detailedEntriesNamesFirst; + QStringList m_dropMimeTypes; + QSignalMapper *m_sortSignalMapper; +}; +struct { + int data[]; +} b; +unsigned c[]{}; +void TreeView::qt_static_metacall(QObject *p1, QMetaObject::Call, int, + void **p4) { + static_cast(p1)->dropMimeData( + 0, 0, 0, *reinterpret_cast(p4)); +} +const QMetaObject TreeView::d{&d, b.data, c, qt_static_metacall}; +void TreeView::disableAction() { QMetaObject::activate(&d, nullptr); } +template struct QScopedPointerDeleter; +class KXMLGUIClientPrivate; +class KXMLGUIClient { +public: + virtual void m_fn2(); + KXMLGUIClient(); + virtual ~KXMLGUIClient(); + KXMLGUIClientPrivate *const d; +}; +class KXMLGUIBuilderPrivate; +class KXMLGUIBuilder { +public: + virtual ~KXMLGUIBuilder(); + virtual QStringList customTags(); + KXMLGUIBuilderPrivate *const d; +}; + +class QMainWindow : public QWidget {}; +class KMainWindowPrivate; +class KMainWindow : public QMainWindow { + KMainWindowPrivate *const k_ptr; +}; +class KXmlGuiWindow : public KMainWindow, + KXMLGUIBuilder, + virtual KXMLGUIClient { +public: + KXmlGuiWindow(); +}; +class QSplitter; +class QAction; +class BasicTab; +class TreeView; +class KTreeWidgetSearchLine; +class KMenuEdit : public KXmlGuiWindow { +public: + KMenuEdit(); + TreeView *m_tree; + BasicTab *m_basicTab; + QSplitter *m_splitter; + KTreeWidgetSearchLine *m_searchLine; + QAction *m_actionDelete; + bool m_showHidden; +}; +int __attribute__((visibility("default"))) fn1() { new KMenuEdit; return 0; } +template struct QTypedArrayData; +class QString { +public: + ~QString(); + QTypedArrayData *d; +}; +class MenuEntryInfo; +class MenuInfo { +public: + virtual ~MenuInfo(); +}; +class MenuFolderInfo : MenuInfo { +public: + void updateFullId(const QString &); + QString id; + QString fullId; + QString caption; + QString genericname; + QString comment; + QString directoryFile; + QString icon; + QList subFolders; + QList entries; + QList initialLayout; + bool dirty; + bool hidden; +}; +void MenuFolderInfo::updateFullId(const QString &) { + for (MenuFolderInfo *a = 0;;) + a->updateFullId(fullId); +} + +MenuFolderInfo *a1, *b1; +bool TreeView::dropMimeData(QTreeWidgetItem *, int, const QMimeData *, + Qt::DropAction) { + b1->updateFullId(a1->fullId); + return true; +} + +class BasicTab { +public: + void slotDisableAction(); +}; + +KMenuEdit::KMenuEdit() { + connect(m_tree, &TreeView::disableAction, m_basicTab, + &BasicTab::slotDisableAction); +} diff --git a/gcc/testsuite/g++.dg/pr93166.C b/gcc/testsuite/g++.dg/pr93166.C deleted file mode 100644 index e9234ce7a0c..00000000000 --- a/gcc/testsuite/g++.dg/pr93166.C +++ /dev/null @@ -1,208 +0,0 @@ -// { dg-do compile } -// { dg-options "-shared -flto -O2 -fPIC -fvisibility=hidden" } - -namespace Qt { -enum DropAction {}; -} -class QObject; -struct QMetaObject { - static void activate(const QMetaObject *, void *); - enum Call {}; - struct { - const QMetaObject *superdata; - int *stringdata; - unsigned *data; - typedef void (*StaticMetacallFunction)(QObject *, Call, int, void **); - StaticMetacallFunction static_metacallrelatedMetaObjectsextradata; - } d; -}; -class QString; -struct QListData { - struct Data; - Data *d; -}; -template class QList { - union { - QListData p; - QListData::Data *d; - }; - -public: - ~QList(); -}; -class QStringList : QList {}; -template struct QScopedPointerDeleter; -class QObjectData; -template > -class QScopedPointer { -public: - ~QScopedPointer(); - QObjectData *d; -}; - -template struct FunctionPointer; -template -struct FunctionPointer { - typedef Obj Object; -}; - -class QObject { -public: - virtual ~QObject(); - virtual void disconnectNotify(); - template - void connect(typename FunctionPointer::Object *, Func1, - typename FunctionPointer::Object *, Func2); - QScopedPointer d_ptr; -}; -class QPaintDevicePrivate; -class QPaintDevice { -public: - virtual ~QPaintDevice(); - unsigned short painters; - QPaintDevicePrivate *reserved; -}; -class QWidgetData; -class QWidget : public QObject, QPaintDevice { - QWidgetData *data; -}; -class QFrame : public QWidget {}; -class QMenu; -class QMimeData; -class QAbstractScrollArea : public QFrame {}; -class QAbstractItemView : public QAbstractScrollArea {}; -class QTreeView : public QAbstractItemView {}; -class QTreeWidgetItem; -class QTreeWidget : public QTreeView {}; -class QSignalMapper; -class KActionCollection; -class MenuFile; -class MenuFolderInfo; -class MenuEntryInfo; -class MenuSeparatorInfo; -class TreeView : QTreeWidget { -public: - static const QMetaObject d; - static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); - void disableAction(); - bool dropMimeData(QTreeWidgetItem *, int, const QMimeData *, Qt::DropAction); - KActionCollection *m_ac; - QMenu *m_popupMenu; - int m_clipboard; - MenuFolderInfo *m_clipboardFolderInfo; - MenuEntryInfo *m_clipboardEntryInfo; - bool m_showHidden; - MenuFile *m_menuFile; - MenuFolderInfo *m_rootFolder; - MenuSeparatorInfo *m_separator; - QStringList m_newMenuIds; - QStringList m_newDirectoryList; - bool m_layoutDirty; - bool m_detailedMenuEntries; - bool m_detailedEntriesNamesFirst; - QStringList m_dropMimeTypes; - QSignalMapper *m_sortSignalMapper; -}; -struct { - int data[]; -} b; -unsigned c[]{}; -void TreeView::qt_static_metacall(QObject *p1, QMetaObject::Call, int, - void **p4) { - static_cast(p1)->dropMimeData( - 0, 0, 0, *reinterpret_cast(p4)); -} -const QMetaObject TreeView::d{&d, b.data, c, qt_static_metacall}; -void TreeView::disableAction() { QMetaObject::activate(&d, nullptr); } -template struct QScopedPointerDeleter; -class KXMLGUIClientPrivate; -class KXMLGUIClient { -public: - virtual void m_fn2(); - KXMLGUIClient(); - virtual ~KXMLGUIClient(); - KXMLGUIClientPrivate *const d; -}; -class KXMLGUIBuilderPrivate; -class KXMLGUIBuilder { -public: - virtual ~KXMLGUIBuilder(); - virtual QStringList customTags(); - KXMLGUIBuilderPrivate *const d; -}; - -class QMainWindow : public QWidget {}; -class KMainWindowPrivate; -class KMainWindow : public QMainWindow { - KMainWindowPrivate *const k_ptr; -}; -class KXmlGuiWindow : public KMainWindow, - KXMLGUIBuilder, - virtual KXMLGUIClient { -public: - KXmlGuiWindow(); -}; -class QSplitter; -class QAction; -class BasicTab; -class TreeView; -class KTreeWidgetSearchLine; -class KMenuEdit : public KXmlGuiWindow { -public: - KMenuEdit(); - TreeView *m_tree; - BasicTab *m_basicTab; - QSplitter *m_splitter; - KTreeWidgetSearchLine *m_searchLine; - QAction *m_actionDelete; - bool m_showHidden; -}; -int __attribute__((visibility("default"))) fn1() { new KMenuEdit; return 0; } -template struct QTypedArrayData; -class QString { -public: - ~QString(); - QTypedArrayData *d; -}; -class MenuEntryInfo; -class MenuInfo { -public: - virtual ~MenuInfo(); -}; -class MenuFolderInfo : MenuInfo { -public: - void updateFullId(const QString &); - QString id; - QString fullId; - QString caption; - QString genericname; - QString comment; - QString directoryFile; - QString icon; - QList subFolders; - QList entries; - QList initialLayout; - bool dirty; - bool hidden; -}; -void MenuFolderInfo::updateFullId(const QString &) { - for (MenuFolderInfo *a = 0;;) - a->updateFullId(fullId); -} - -MenuFolderInfo *a1, *b1; -bool TreeView::dropMimeData(QTreeWidgetItem *, int, const QMimeData *, - Qt::DropAction) { - b1->updateFullId(a1->fullId); - return true; -} - -class BasicTab { -public: - void slotDisableAction(); -}; - -KMenuEdit::KMenuEdit() { - connect(m_tree, &TreeView::disableAction, m_basicTab, - &BasicTab::slotDisableAction); -}