summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/constvars.c14
-rw-r--r--gdb/testsuite/gdb.base/volatile.exp24
2 files changed, 38 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/constvars.c b/gdb/testsuite/gdb.base/constvars.c
index 42288223d99..60cca2a9fc1 100644
--- a/gdb/testsuite/gdb.base/constvars.c
+++ b/gdb/testsuite/gdb.base/constvars.c
@@ -127,6 +127,16 @@ main (void)
volatile float * volatile vitality = &vacuity;
volatile double * volatile voracity = &vertigo;
+ /* volatile arrays */
+ volatile char violent[2] = {vox, vox};
+ volatile unsigned char violet[2] = {victuals, victuals};
+ volatile short vips[2] = {vixen, vixen};
+ volatile unsigned short virgen[2] = {vitriol, vitriol};
+ volatile long vulgar[2] = {vellum, vellum};
+ volatile unsigned long vulture[2] = {valve, valve};
+ volatile float vilify[2] = {vacuity, vacuity};
+ volatile double villar[2] = {vertigo, vertigo};
+
/* const volatile vars */
const volatile char victor = 'Y';
@@ -177,6 +187,10 @@ main (void)
const volatile char * const volatile vagary = &victor;
const volatile unsigned char * const volatile vendor = &vicar;
+ /* const volatile arrays */
+ const volatile char vindictive[2] = {victor, victor};
+ const volatile unsigned char vegetation[2] = {vicar, vicar};
+
/* various structs with const members */
struct crass { char * const ptr; } crass = { lamprey };
diff --git a/gdb/testsuite/gdb.base/volatile.exp b/gdb/testsuite/gdb.base/volatile.exp
index 7cd7254d572..0e106fc2e5e 100644
--- a/gdb/testsuite/gdb.base/volatile.exp
+++ b/gdb/testsuite/gdb.base/volatile.exp
@@ -229,6 +229,30 @@ gdb_test "ptype vagary" "type = const volatile char \\* const volatile.*"
local_compiler_xfail_check
gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile.*"
+# volatile arrays
+local_compiler_xfail_check
+gdb_test "ptype violent" "type = volatile char \\\[2\\\]"
+local_compiler_xfail_check
+gdb_test "ptype violet" "type = volatile unsigned char \\\[2\\\]"
+local_compiler_xfail_check
+gdb_test "ptype vips" "type = volatile short( int)? \\\[2\\\]"
+local_compiler_xfail_check
+gdb_test "ptype virgen" "type = volatile (unsigned short|short unsigned)( int)? \\\[2\\\]"
+local_compiler_xfail_check
+gdb_test "ptype vulgar" "type = volatile long( int)? \\\[2\\\]"
+local_compiler_xfail_check
+gdb_test "ptype vulture" "type = volatile (unsigned long|long unsigned)( int)? \\\[2\\\]"
+local_compiler_xfail_check
+gdb_test "ptype vilify" "type = volatile float \\\[2\\\]"
+local_compiler_xfail_check
+gdb_test "ptype villar" "type = volatile double \\\[2\\\]"
+
+# const volatile arrays
+local_compiler_xfail_check
+gdb_test "ptype vindictive" "type = const volatile char \\\[2\\\]"
+local_compiler_xfail_check
+gdb_test "ptype vegetation" "type = const volatile unsigned char \\\[2\\\]"
+
# test function parameters
local_compiler_xfail_check
local_compiler_xfail_check_2