diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/visibility-7.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/visibility-7.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/visibility-7.c b/gcc/testsuite/gcc.dg/visibility-7.c new file mode 100644 index 0000000..e98b432 --- /dev/null +++ b/gcc/testsuite/gcc.dg/visibility-7.c @@ -0,0 +1,12 @@ +/* Test warning from conflicting visibility specifications. */ +/* { dg-do compile } */ +/* { dg-require-visibility "" } */ +/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */ + +extern int +__attribute__((visibility ("hidden"))) +xyzzy; /* { dg-warning "previous declaration here" "" } */ + +int +__attribute__((visibility ("protected"))) +xyzzy = 5; /* { dg-warning "visibility attribute ignored" "" } */ |