From c08baff7c84b0b96d12d6fd2dd3c9fd44ee3c703 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 24 May 2016 16:36:43 -0400 Subject: [PATCH 28/35] FIXME: add test-tests.c --- gcc/Makefile.in | 1 + gcc/test-tests.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 gcc/test-tests.c diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 9f47fb1..a27a9af 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1438,6 +1438,7 @@ OBJS = \ ubsan.o \ sanopt.o \ sancov.o \ + test-tests.o \ tree-call-cdce.o \ tree-cfg.o \ tree-cfgcleanup.o \ diff --git a/gcc/test-tests.c b/gcc/test-tests.c new file mode 100644 index 0000000..d24df00 --- /dev/null +++ b/gcc/test-tests.c @@ -0,0 +1,44 @@ +/* Test of tests. + Copyright (C) 2016 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "selftest.h" + +/* Verify that a file containing just tests is supported. */ + +#if CHECKING_P + +static int __attribute__((noinline,noclone)) +dummy_fn (int i) +{ + return i * i; +} + +namespace { + +TEST (foo_test, bar) +{ + EXPECT_EQ (dummy_fn (5), 25); +} + +} // anon namespace + +#endif /* #if CHECKING_P */ -- 1.8.5.3