summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/sizeof.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-07-13 05:07:54 +0000
committerAndrew Cagney <cagney@redhat.com>2000-07-13 05:07:54 +0000
commit2391e11d3a331a700cd44fe6af314a5f5adfeea0 (patch)
tree5ae5444681fa123ffb93e589bb2d10f9b770ed37 /gdb/testsuite/gdb.base/sizeof.c
parent5b4cf3f497bc6294cb2c2743de649ffaeff3a6d0 (diff)
downloadbinutils-gdb-2391e11d3a331a700cd44fe6af314a5f5adfeea0.tar.gz
Check that GDB and the C compiler agree about the sizeof a few basic C
types.
Diffstat (limited to 'gdb/testsuite/gdb.base/sizeof.c')
-rw-r--r--gdb/testsuite/gdb.base/sizeof.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/sizeof.c b/gdb/testsuite/gdb.base/sizeof.c
new file mode 100644
index 00000000000..bdc3d02e5ba
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sizeof.c
@@ -0,0 +1,17 @@
+int
+main ()
+{
+ printf ("sizeof (char) == %d\n", sizeof (char));
+ printf ("sizeof (short) == %d\n", sizeof (short));
+ printf ("sizeof (int) == %d\n", sizeof (int));
+ printf ("sizeof (long) == %d\n", sizeof (long));
+ printf ("sizeof (long long) == %d\n", sizeof (long long));
+
+ printf ("sizeof (void *) == %d\n", sizeof (void*));
+ printf ("sizeof (void (*)(void)) == %d\n", sizeof (void (*)(void)));
+
+ printf ("sizeof (float) == %d\n", sizeof (float));
+ printf ("sizeof (double) == %d\n", sizeof (double));
+ printf ("sizeof (long double) == %d\n", sizeof (long double));
+ return 0;
+}