summaryrefslogtreecommitdiff
path: root/tests/auto/valgrind/memcheck/testapps
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@digia.com>2013-02-22 17:07:43 +0100
committerhjk <hjk121@nokiamail.com>2013-04-02 14:20:23 +0200
commite6c0c292b9c35a2a9b7a7496c8a03e0906613f95 (patch)
tree22b086682c44b873342ccf96c5e7e6e542080975 /tests/auto/valgrind/memcheck/testapps
parentf1b358562c461e1891ad2b988c48f7d9383bdb83 (diff)
downloadqt-creator-e6c0c292b9c35a2a9b7a7496c8a03e0906613f95.tar.gz
tests: move valgrind into auto tests
* re-added some test data files * added QSKIP for not existing data files Change-Id: Ie0ae3f563e0d94534b620320176b7ec56e36d313 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'tests/auto/valgrind/memcheck/testapps')
-rw-r--r--tests/auto/valgrind/memcheck/testapps/free1/free1.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/free1/main.cpp38
-rw-r--r--tests/auto/valgrind/memcheck/testapps/free2/free2.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/free2/main.cpp37
-rw-r--r--tests/auto/valgrind/memcheck/testapps/invalidjump/invalidjump.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/invalidjump/main.cpp37
-rw-r--r--tests/auto/valgrind/memcheck/testapps/leak1/leak1.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/leak1/main.cpp36
-rw-r--r--tests/auto/valgrind/memcheck/testapps/leak2/leak2.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/leak2/main.cpp42
-rw-r--r--tests/auto/valgrind/memcheck/testapps/leak3/leak3.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/leak3/main.cpp39
-rw-r--r--tests/auto/valgrind/memcheck/testapps/leak4/leak4.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/leak4/main.cpp46
-rw-r--r--tests/auto/valgrind/memcheck/testapps/overlap/main.cpp38
-rw-r--r--tests/auto/valgrind/memcheck/testapps/overlap/overlap.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/syscall/main.cpp36
-rw-r--r--tests/auto/valgrind/memcheck/testapps/syscall/syscall.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/testapps.pro4
-rw-r--r--tests/auto/valgrind/memcheck/testapps/uninit1/main.cpp40
-rw-r--r--tests/auto/valgrind/memcheck/testapps/uninit1/uninit1.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/uninit2/main.cpp38
-rw-r--r--tests/auto/valgrind/memcheck/testapps/uninit2/uninit2.pro8
-rw-r--r--tests/auto/valgrind/memcheck/testapps/uninit3/main.cpp36
-rw-r--r--tests/auto/valgrind/memcheck/testapps/uninit3/uninit3.pro8
25 files changed, 563 insertions, 0 deletions
diff --git a/tests/auto/valgrind/memcheck/testapps/free1/free1.pro b/tests/auto/valgrind/memcheck/testapps/free1/free1.pro
new file mode 100644
index 0000000000..0b7ac8d808
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/free1/free1.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = free1
+
+QT -= core gui
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/free1/main.cpp b/tests/auto/valgrind/memcheck/testapps/free1/main.cpp
new file mode 100644
index 0000000000..1dbd64bf4f
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/free1/main.cpp
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include <cstdlib>
+
+int main()
+{
+ int *p = new int;
+ delete p;
+ delete p;
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/free2/free2.pro b/tests/auto/valgrind/memcheck/testapps/free2/free2.pro
new file mode 100644
index 0000000000..1c1f7a5098
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/free2/free2.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = free2
+
+QT -= core gui
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/free2/main.cpp b/tests/auto/valgrind/memcheck/testapps/free2/main.cpp
new file mode 100644
index 0000000000..664b81ddf3
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/free2/main.cpp
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include <cstdlib>
+
+int main()
+{
+ int *p = new int;
+ free(p);
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/invalidjump/invalidjump.pro b/tests/auto/valgrind/memcheck/testapps/invalidjump/invalidjump.pro
new file mode 100644
index 0000000000..7f7a231327
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/invalidjump/invalidjump.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = invalidjump
+
+QT -= core gui
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/invalidjump/main.cpp b/tests/auto/valgrind/memcheck/testapps/invalidjump/main.cpp
new file mode 100644
index 0000000000..bc9fa8bd6d
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/invalidjump/main.cpp
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+void foo() { }
+
+int main()
+{
+ void (*fooPtr)() = 0;
+ fooPtr();
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/leak1/leak1.pro b/tests/auto/valgrind/memcheck/testapps/leak1/leak1.pro
new file mode 100644
index 0000000000..2b5b6b8be8
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/leak1/leak1.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = leak1
+
+QT += core
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/leak1/main.cpp b/tests/auto/valgrind/memcheck/testapps/leak1/main.cpp
new file mode 100644
index 0000000000..a531d66085
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/leak1/main.cpp
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include <qglobal.h>
+
+int main()
+{
+ new qint64;
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/leak2/leak2.pro b/tests/auto/valgrind/memcheck/testapps/leak2/leak2.pro
new file mode 100644
index 0000000000..8b9b2717a7
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/leak2/leak2.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = leak2
+
+QT += core
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/leak2/main.cpp b/tests/auto/valgrind/memcheck/testapps/leak2/main.cpp
new file mode 100644
index 0000000000..bee6ef2990
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/leak2/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include <string.h>
+
+char *lower;
+
+int main()
+{
+ lower = strdup("asdf");
+
+ while (*lower)
+ lower++;
+
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/leak3/leak3.pro b/tests/auto/valgrind/memcheck/testapps/leak3/leak3.pro
new file mode 100644
index 0000000000..aaefab13df
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/leak3/leak3.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = leak3
+
+QT += core
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/leak3/main.cpp b/tests/auto/valgrind/memcheck/testapps/leak3/main.cpp
new file mode 100644
index 0000000000..5f972ef434
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/leak3/main.cpp
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include <string.h>
+
+char *lower;
+
+int main()
+{
+ lower = strdup("asdf");
+
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/leak4/leak4.pro b/tests/auto/valgrind/memcheck/testapps/leak4/leak4.pro
new file mode 100644
index 0000000000..ebbafbd51a
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/leak4/leak4.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = leak4
+
+QT += core
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/leak4/main.cpp b/tests/auto/valgrind/memcheck/testapps/leak4/main.cpp
new file mode 100644
index 0000000000..ddab9fa60e
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/leak4/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include <qglobal.h>
+
+struct Foo
+{
+ Foo()
+ : num(new qint64)
+ {}
+
+ qint64 *num;
+};
+
+int main()
+{
+ new Foo;
+
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/overlap/main.cpp b/tests/auto/valgrind/memcheck/testapps/overlap/main.cpp
new file mode 100644
index 0000000000..1ef99bb299
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/overlap/main.cpp
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#include <string.h>
+
+int main()
+{
+ int *i = new int[10];
+ memcpy(i, &i[1], 20);
+ delete[] i;
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/overlap/overlap.pro b/tests/auto/valgrind/memcheck/testapps/overlap/overlap.pro
new file mode 100644
index 0000000000..cad970b1fa
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/overlap/overlap.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = overlap
+
+QT -= core gui
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/syscall/main.cpp b/tests/auto/valgrind/memcheck/testapps/syscall/main.cpp
new file mode 100644
index 0000000000..01e8b22bac
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/syscall/main.cpp
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#pragma GCC diagnostic ignored "-Wuninitialized"
+
+int main()
+{
+ int i;
+ return i;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/syscall/syscall.pro b/tests/auto/valgrind/memcheck/testapps/syscall/syscall.pro
new file mode 100644
index 0000000000..e54d4d379e
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/syscall/syscall.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = syscall
+
+QT += core
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/testapps.pro b/tests/auto/valgrind/memcheck/testapps/testapps.pro
new file mode 100644
index 0000000000..90490cf34c
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/testapps.pro
@@ -0,0 +1,4 @@
+TEMPLATE = subdirs
+
+SUBDIRS += leak1 leak2 leak3 leak4 uninit1 uninit2 syscall free1 uninit3 free2 invalidjump \
+ overlap
diff --git a/tests/auto/valgrind/memcheck/testapps/uninit1/main.cpp b/tests/auto/valgrind/memcheck/testapps/uninit1/main.cpp
new file mode 100644
index 0000000000..6ddd7f39b0
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/uninit1/main.cpp
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#pragma GCC diagnostic ignored "-Wuninitialized"
+
+int main()
+{
+ bool b;
+ if (b) {
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/uninit1/uninit1.pro b/tests/auto/valgrind/memcheck/testapps/uninit1/uninit1.pro
new file mode 100644
index 0000000000..26ab0e0689
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/uninit1/uninit1.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = uninit1
+
+QT -= core gui
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/uninit2/main.cpp b/tests/auto/valgrind/memcheck/testapps/uninit2/main.cpp
new file mode 100644
index 0000000000..e472fc5470
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/uninit2/main.cpp
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#pragma GCC diagnostic ignored "-Wuninitialized"
+
+int main()
+{
+ int *i;
+ *i = 5;
+
+ return 0;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/uninit2/uninit2.pro b/tests/auto/valgrind/memcheck/testapps/uninit2/uninit2.pro
new file mode 100644
index 0000000000..7e5f89e0b5
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/uninit2/uninit2.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = uninit2
+
+QT -= core gui
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp
diff --git a/tests/auto/valgrind/memcheck/testapps/uninit3/main.cpp b/tests/auto/valgrind/memcheck/testapps/uninit3/main.cpp
new file mode 100644
index 0000000000..6b251b2602
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/uninit3/main.cpp
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+#pragma GCC diagnostic ignored "-Wuninitialized"
+
+int main()
+{
+ int *i;
+ return *i;
+}
diff --git a/tests/auto/valgrind/memcheck/testapps/uninit3/uninit3.pro b/tests/auto/valgrind/memcheck/testapps/uninit3/uninit3.pro
new file mode 100644
index 0000000000..102d0cae83
--- /dev/null
+++ b/tests/auto/valgrind/memcheck/testapps/uninit3/uninit3.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = uninit3
+
+QT -= core gui
+
+macx:CONFIG -= app_bundle
+
+SOURCES += main.cpp