pragma-override1.C: Mark as requiring 'internal' visibility.

* g++.dg/ext/visibility/pragma-override1.C: Mark as requiring
	'internal' visibility.
	* g++.dg/ext/visibility/pragma-override2.C: Likewise.
	* g++.dg/ext/visibility/visibility-7.C: Mark as requiring
	'protected' visibility.
	* gcc.dg/visibility-7.c: Likewise.
	* lib/target-supports.exp (check_visibility_available): Take
	a parameter, the kind of visibility to check for.
	* lib/target-supports-dg.exp (dg-require-visibility): Pass parameter
	to check_visibility_available.

From-SVN: r97031
This commit is contained in:
Geoffrey Keating 2005-03-25 02:21:01 +00:00 committed by Geoffrey Keating
parent 0811c49e73
commit d3d9a67f7e
7 changed files with 40 additions and 17 deletions

View File

@ -4,6 +4,17 @@
2005-03-24 Geoffrey Keating <geoffk@apple.com>
* g++.dg/ext/visibility/pragma-override1.C: Mark as requiring
'internal' visibility.
* g++.dg/ext/visibility/pragma-override2.C: Likewise.
* g++.dg/ext/visibility/visibility-7.C: Mark as requiring
'protected' visibility.
* gcc.dg/visibility-7.c: Likewise.
* lib/target-supports.exp (check_visibility_available): Take
a parameter, the kind of visibility to check for.
* lib/target-supports-dg.exp (dg-require-visibility): Pass parameter
to check_visibility_available.
* g++.dg/expr/cast3.C: New.
2005-03-24 David Edelsohn <edelsohn@gnu.org>

View File

@ -1,6 +1,6 @@
/* Test that #pragma GCC visibility does not override class member specific settings. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-require-visibility "internal" } */
/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" } } */
#pragma GCC visibility push(hidden)

View File

@ -1,6 +1,6 @@
/* Test that #pragma GCC visibility does not override class member specific settings. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-require-visibility "internal" } */
/* { dg-final { scan-assembler "\\.internal.*Foo.methodEv" } } */
#pragma GCC visibility push(hidden)

View File

@ -1,5 +1,5 @@
/* Test warning from conflicting visibility specifications. */
/* { dg-require-visibility "" } */
/* { dg-require-visibility "protected" } */
/* { dg-final { scan-hidden "xyzzy" } } */
extern int

View File

@ -1,6 +1,6 @@
/* Test warning from conflicting visibility specifications. */
/* { dg-do compile } */
/* { dg-require-visibility "" } */
/* { dg-require-visibility "protected" } */
/* { dg-final { scan-hidden "xyzzy" } } */
extern int

View File

@ -32,7 +32,7 @@ proc dg-require-weak { args } {
# test.
proc dg-require-visibility { args } {
set visibility_available [ check_visibility_available ]
set visibility_available [ check_visibility_available [lindex $args 1 ] ]
if { $visibility_available == -1 } {
upvar name name
unresolved "$name"

View File

@ -110,13 +110,14 @@ proc check_weak_available { } {
}
###############################
# proc check_visibility_available { }
# proc check_visibility_available { what_kind }
###############################
# The visibility attribute is only support in some object formats
# This proc returns 1 if it is supported, 0 if not.
# The argument is the kind of visibility, default/protected/hidden/internal.
proc check_visibility_available { } {
proc check_visibility_available { what_kind } {
global visibility_available_saved
global tool
global target_triplet
@ -126,18 +127,29 @@ proc check_visibility_available { } {
return 0
}
if {![info exists visibility_available_saved] } {
set lines [get_compiler_messages visibility object {
void f() __attribute__((visibility("hidden")));
void f() {}
}]
if [string match "" $lines] then {
set visibility_available_saved 1
} else {
set visibility_available_saved 0
if [string match "" $what_kind] { set what_kind "hidden" }
if { [info exists visibility_available_saved] } {
verbose "Saved result is <$visibility_available_saved>" 1
if { [ lsearch -exact $visibility_available_saved $what_kind ] != -1 } {
return 1
} elseif { [ lsearch -exact $visibility_available_saved "!$what_kind" ] != -1 } {
return 0
}
}
return $visibility_available_saved
set lines [get_compiler_messages visibility object "
void f() __attribute__((visibility(\"$what_kind\")));
void f() {}
"]
if [string match "" $lines] then {
set answer 1
lappend visibility_available_saved $what_kind
} else {
set answer 0
lappend visibility_available_saved "!$what_kind"
}
return $answer
}
###############################