--- /dev/null
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2023 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
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
+
+extern int foo (void);
+
+int
+foo (void)
+{
+ return 0;
+}
# This test checks that the index-cache feature generates the expected files at
# the expected location.
-standard_testfile
+standard_testfile .c -2.c
-if { [build_executable "failed to prepare" $testfile $srcfile \
+if { [build_executable "failed to prepare" $testfile [list $srcfile $srcfile2] \
{debug ldflags=-Wl,--build-id}] } {
return
}
gdb_assert "$nfiles_created == 0" "no files were created"
check_cache_stats 0 0
+
+ # Trigger expansion of symtab containing main, if not already done.
+ gdb_test "ptype main" "^type = int \\(void\\)"
+
+ # Trigger expansion of symtab not containing main.
+ gdb_test "ptype foo" "^type = int \\(void\\)"
}
}
}
} else {
check_cache_stats 0 0
}
+
+ # Trigger expansion of symtab containing main, if not already done.
+ gdb_test "ptype main" "^type = int \\(void\\)"
+
+ # Trigger expansion of symtab not containing main.
+ gdb_test "ptype foo" "^type = int \\(void\\)"
}
}
} else {
check_cache_stats 0 0
}
+
+ # Trigger expansion of symtab containing main, if not already done.
+ gdb_test "ptype main" "^type = int \\(void\\)"
+
+ # Trigger expansion of symtab not containing main.
+ gdb_test "ptype foo" "^type = int \\(void\\)"
}
}