This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Add some multi-file tests
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 7 Nov 2008 22:18:26 -0500
- Subject: [lto] Add some multi-file tests
This adds multi-file tests for the patches
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00983.html
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00962.html
It also fixes support for dg-do link in lto.exp. Notice that for
the link step to work, one of the files in the set must define
'main'.
Tested on x86_64.
Diego.
* lib/lto.exp: Fix copyright years.
(lto-get-options-main): Support dg-do link.
* g++.dg/lto/20081022.h: New.
* g++.dg/lto/20081022_0.C: New.
* g++.dg/lto/20081023_0.C: New.
* g++.dg/lto/20081022_1.C: New.
Index: g++.dg/lto/20081022.h
===================================================================
--- g++.dg/lto/20081022.h (revision 0)
+++ g++.dg/lto/20081022.h (revision 0)
@@ -0,0 +1,8 @@
+class foo
+{
+public:
+ int bar ()
+ {
+ return 0;
+ }
+};
Index: g++.dg/lto/20081022_0.C
===================================================================
--- g++.dg/lto/20081022_0.C (revision 0)
+++ g++.dg/lto/20081022_0.C (revision 0)
@@ -0,0 +1,11 @@
+#include "20081022.h"
+
+int
+f (foo * a)
+{
+ return a->bar ();
+}
+
+main()
+{
+}
Index: g++.dg/lto/20081023_0.C
===================================================================
--- g++.dg/lto/20081023_0.C (revision 0)
+++ g++.dg/lto/20081023_0.C (revision 0)
@@ -0,0 +1,14 @@
+// { dg-do "link" }
+extern inline void __attribute__ ((__always_inline__)) func (void)
+{
+}
+
+void
+f (void)
+{
+ func ();
+}
+
+main()
+{
+}
Index: g++.dg/lto/20081022_1.C
===================================================================
--- g++.dg/lto/20081022_1.C (revision 0)
+++ g++.dg/lto/20081022_1.C (revision 0)
@@ -0,0 +1,7 @@
+#include "20081022.h"
+
+int
+g (foo * a)
+{
+ return a->bar ();
+}
Index: lib/lto.exp
===================================================================
--- lib/lto.exp (revision 141704)
+++ lib/lto.exp (working copy)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2008 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -179,8 +179,10 @@ proc lto-get-options-main { src } {
set compile_type "compile"
} elseif { ![string compare "run" $dgdo] } {
set compile_type "run"
+ } elseif { ![string compare "link" $dgdo] } {
+ set compile_type "link"
} else {
- warning "lto.exp does not support $cmd"
+ warning "lto.exp does not support dg-do $dgdo"
}
} else {
# Ignore unrecognized dg- commands, but warn about them.