Suppress explicit dwarf2 tests under Clang due to reliance on global inline asm ordering
Commit Message
(contrary to my prior claim, I do seem to have commit after review
access to gdb (I see my name in the commit log) - I'll just have to
figure out how to do that... - so I just need approval, don't need
someone to commit this for me)
These were all the tests that I could find that had "asm.*\.globl" in
a c file. All of them had failures under Clang except for
dw2-unresolved.exp, though the resulting dwarf would still be
incorrect in that test it was just "getting lucky", I suppose. For
sanity I disabled it as well.
"unsupported" seemed like the right result to use according to
http://ftp.gnu.org/old-gnu/Manuals/dejagnu-1.3/html_chapter/dejagnu_3.html
- even though "untested" seems to be often used synonymously (the
dejagnu manual seems to indicate that untested shouldn't be used for
these sort of cases where there is test coverage it just can't be run
in this configuration).
>From the commit message/ChangeLog:
Flag explicit dwarf2 tests as unsupported under Clang.
Clang doesn't guarantee ordering of global and namespace scope inline
asm relative to other entities, even at -O0. This ordering is required
to define the range labels for the dwarf2 tests containing hardcoded
assembly files.
Introduce a detection utility function and use that in the handful of
test cases that rely on this feature.
gdb/testsuite
* lib/gdb.exp (has_unreliable_inline_asm_ordering): Utility function
for testing support for global or namespace scope inline asm ordering.
* gdb.dwarf2/dw2-abs-hi-pc.exp: Unsupported under the above condition.
* gdb.dwarf2/dw2-case-insensitive.exp: Ditto
* gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Ditto
* gdb.dwarf2/dw2-entry-value.exp: Ditto
* gdb.dwarf2/dw2-ifort-parameter.exp: Ditto
* gdb.dwarf2/dw2-inline-param.exp: Ditto
* gdb.dwarf2/dw2-noloc.exp: Ditto
* gdb.dwarf2/dw2-param-error.exp: Ditto
* gdb.dwarf2/dw2-ref-missing-frame.exp: Ditto
* gdb.dwarf2/dw2-skip-prologue.exp: Ditto
* gdb.dwarf2/dw2-unresolved.exp: Ditto
* gdb.mi/dw2-ref-missing-frame.exp: Ditto
commit eabfb416b9f232d64f356e86c77e22f8403d5aa4
Author: David Blaikie <dblaikie@gmail.com>
Date: Tue Apr 8 14:03:04 2014 -0700
Flag explicit dwarf2 tests as unsupported under Clang.
Clang doesn't guarantee ordering of global and namespace scope inline
asm relative to other entities, even at -O0. This ordering is required
to define the range labels for the dwarf2 tests containing hardcoded
assembly files.
Introduce a detection utility function and use that in the handful of
test cases that rely on this feature.
gdb/testsuite
* lib/gdb.exp (has_unreliable_inline_asm_ordering): Utility function
for testing support for global or namespace scope inline asm ordering.
* gdb.dwarf2/dw2-abs-hi-pc.exp: Unsupported under the above condition.
* gdb.dwarf2/dw2-case-insensitive.exp: Ditto
* gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Ditto
* gdb.dwarf2/dw2-entry-value.exp: Ditto
* gdb.dwarf2/dw2-ifort-parameter.exp: Ditto
* gdb.dwarf2/dw2-inline-param.exp: Ditto
* gdb.dwarf2/dw2-noloc.exp: Ditto
* gdb.dwarf2/dw2-param-error.exp: Ditto
* gdb.dwarf2/dw2-ref-missing-frame.exp: Ditto
* gdb.dwarf2/dw2-skip-prologue.exp: Ditto
* gdb.dwarf2/dw2-unresolved.exp: Ditto
* gdb.mi/dw2-ref-missing-frame.exp: Ditto
Comments
On 04/08/2014 10:22 PM, David Blaikie wrote:
> (contrary to my prior claim, I do seem to have commit after review
> access to gdb (I see my name in the commit log) - I'll just have to
> figure out how to do that... - so I just need approval, don't need
> someone to commit this for me)
>
> These were all the tests that I could find that had "asm.*\.globl" in
> a c file. All of them had failures under Clang except for
> dw2-unresolved.exp, though the resulting dwarf would still be
> incorrect in that test it was just "getting lucky", I suppose. For
> sanity I disabled it as well.
>
> "unsupported" seemed like the right result to use according to
> http://ftp.gnu.org/old-gnu/Manuals/dejagnu-1.3/html_chapter/dejagnu_3.html
> - even though "untested" seems to be often used synonymously (the
> dejagnu manual seems to indicate that untested shouldn't be used for
> these sort of cases where there is test coverage it just can't be run
> in this configuration).
>
> From the commit message/ChangeLog:
>
> Flag explicit dwarf2 tests as unsupported under Clang.
>
> Clang doesn't guarantee ordering of global and namespace scope inline
> asm relative to other entities, even at -O0.
You mean that the asms might end up emitted with order swapped, or
that other code might end up in between them? I suspect the latter.
Can please you show a GCC vs clang example? If indeed the latter,
this is something that GCC itself might do too with optimization
enabled, right?
@@ -1,3 +1,20 @@
+2014-04-08 David Blaikie <dblaikie@gmail.com>
+
+ * lib/gdb.exp (has_unreliable_inline_asm_ordering): Utility function
+ for testing support for global or namespace scope inline asm ordering.
+ * gdb.dwarf2/dw2-abs-hi-pc.exp: Unsupported under the above condition.
+ * gdb.dwarf2/dw2-case-insensitive.exp: Ditto
+ * gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Ditto
+ * gdb.dwarf2/dw2-entry-value.exp: Ditto
+ * gdb.dwarf2/dw2-ifort-parameter.exp: Ditto
+ * gdb.dwarf2/dw2-inline-param.exp: Ditto
+ * gdb.dwarf2/dw2-noloc.exp: Ditto
+ * gdb.dwarf2/dw2-param-error.exp: Ditto
+ * gdb.dwarf2/dw2-ref-missing-frame.exp: Ditto
+ * gdb.dwarf2/dw2-skip-prologue.exp: Ditto
+ * gdb.dwarf2/dw2-unresolved.exp: Ditto
+ * gdb.mi/dw2-ref-missing-frame.exp: Ditto
+
2014-04-08 Pierre Muller <muller@sourceware.org>
* gdb.base/printcmds.exp (test_artificial_arrays): Disable
@@ -19,6 +19,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile
set executable ${testfile}
@@ -19,6 +19,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile .c dw2-case-insensitive-debug.S
if { [prepare_for_testing ${testfile}.exp ${testfile} \
@@ -25,6 +25,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile .S dw2-cp-infcall-ref-static-main.c
if { [prepare_for_testing ${testfile}.exp ${testfile} \
@@ -19,6 +19,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
if { [prepare_for_testing dw2-entry-value.exp "dw2-entry-value" {dw2-entry-value-main.c dw2-entry-value.S} {nodebug}] } {
return -1
}
@@ -22,6 +22,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile .c dw2-ifort-parameter-dw.S
# Make some DWARF for the test.
@@ -19,6 +19,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile .S dw2-inline-param-main.c
if { [prepare_for_testing ${testfile}.exp "${testfile}" \
@@ -19,6 +19,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
if { [prepare_for_testing dw2-noloc.exp "dw2-noloc" {dw2-noloc-main.c dw2-noloc.S} {nodebug}] } {
return -1
}
@@ -19,6 +19,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile .S dw2-param-error-main.c
if { [prepare_for_testing ${testfile}.exp "${testfile}" \
@@ -19,6 +19,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile .S
set srcfuncfile ${testfile}-func.c
set srcmainfile ${testfile}-main.c
@@ -36,6 +36,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile
set executable ${testfile}
@@ -19,6 +19,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
if { [prepare_for_testing dw2-unresolved.exp "dw2-unresolved" {dw2-unresolved-main.c dw2-unresolved.S} {nodebug}] } {
return -1
}
@@ -22,6 +22,11 @@ if {![dwarf2_support]} {
return 0
}
+if [has_unreliable_inline_asm_ordering] {
+ unsupported "Compiler doesn't guarantee ordering of global inline asm relative to other entities"
+ return 0
+}
+
standard_testfile .S dw2-ref-missing-frame-func.c dw2-ref-missing-frame-main.c
set objsfile [standard_output_file ${testfile}.o]
set objfuncfile [standard_output_file ${testfile}-func.o]
@@ -2592,6 +2592,10 @@ proc test_compiler_info { {compiler ""} } {
return [string match $compiler $compiler_info]
}
+proc has_unreliable_inline_asm_ordering { } {
+ return ![get_compiler_info] && [test_compiler_info clang*]
+}
+
proc current_target_name { } {
global target_info
if [info exists target_info(target,name)] {