summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-27 00:20:03 +0000
committerechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-27 00:20:03 +0000
commitc1d73e214d258ac9f440339cc3d305b5d74f24a0 (patch)
tree9a02867216571663e8a78b4717752c799bbfd856 /gcc/testsuite/gcc.c-torture
parent02bdd3882e7cb5949e6ff74848b8fc02abe6f1eb (diff)
downloadgcc-c1d73e214d258ac9f440339cc3d305b5d74f24a0.tar.gz
2004-07-26 Eric Christopher <echristo@redhat.com>
* tree-dfa.c (add_referenced_var): Register initializers of global variables. 2004-07-26 Eric Christopher <echristo@redhat.com> * gcc.c-torture/compile/20040726-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85214 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20040726-2.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040726-2.c b/gcc/testsuite/gcc.c-torture/compile/20040726-2.c
new file mode 100644
index 00000000000..ce60095fd8b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20040726-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* From a failure after the global ccp pass. */
+typedef struct
+{
+ char n[129];
+} A;
+
+const A C = {
+ 0,
+ 0
+};
+
+extern const A *const B;
+
+void bar(const char *);
+
+void foo ()
+{
+ bar (B->n);
+}
+
+const A *const B = &C;