summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-C.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/uninit-C.c')
-rw-r--r--gcc/testsuite/gcc.dg/uninit-C.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-C.c b/gcc/testsuite/gcc.dg/uninit-C.c
new file mode 100644
index 000000000..a22f0d78d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-C.c
@@ -0,0 +1,21 @@
+/* Spurious uninitialized variable warning, inspired by libgcc2.c. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+/* Not all platforms support TImode integers. */
+#if (defined(__LP64__) && !defined(__hppa__)) || defined(__SPU__)
+typedef int TItype __attribute__ ((mode (TI)));
+#else
+typedef long TItype;
+#endif
+
+
+TItype
+__subvdi3 (TItype a, TItype b)
+{
+ TItype w;
+
+ w = a - b;
+
+ return w;
+}