Disable Clang's integrated assembler for two testcases
authorGary Benson <gbenson@redhat.com>
Tue, 25 Aug 2020 14:25:04 +0000 (15:25 +0100)
committerGary Benson <gbenson@redhat.com>
Tue, 25 Aug 2020 14:25:04 +0000 (15:25 +0100)
gdb.dwarf2/dw2-dir-file-name.exp fails to build using Clang because
the generated assembly language contains .ascii directives with more
than one string literal.  gdb.dwarf2/dw2-restore.exp fails to build
using Clang because it contains .func and .endfunc directives.
This commit causes Clang to invoke the system assembler to assemble
the relevant files.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/dw2-dir-file-name.exp: Use system assembler
when compiling with clang.
* gdb.dwarf2/dw2-restore.exp: Likewise

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp
gdb/testsuite/gdb.dwarf2/dw2-restore.exp

index 93df7f9c5d274a13f9c979ed353e5e177cc2536d..a945a5786b1d23a9c6506742b9067f2a162bdf2e 100644 (file)
@@ -1,3 +1,9 @@
+2020-08-25  Gary Benson <gbenson@redhat.com>
+
+       * gdb.dwarf2/dw2-dir-file-name.exp: Use system assembler
+       when compiling with clang.
+       * gdb.dwarf2/dw2-restore.exp: Likewise
+
 2020-08-25  Gary Benson <gbenson@redhat.com>
 
        * gdb.cp/ambiguous.exp: Enable test when compiling with GCC.
index 0de71f29d50015b91acad80925bb7b3677c6f603..973325f55f228361b00815c7e7caed69ea2c508c 100644 (file)
@@ -333,6 +333,12 @@ lappend opts "additional_flags=-DFDIR=\"fdir\""
 # CU's DW_AT_name and .debug_line's filename.
 lappend opts "additional_flags=-DFILE=\"${srctmpfile}\""
 
+# Clang's integrated assembler doesn't support .ascii directives
+# with multiple string literals.
+if { [test_compiler_info clang*] } {
+    lappend opts "additional_flags=-fno-integrated-as"
+}
+
 if { [gdb_compile "${asmsrcfile} ${srcdir}/${subdir}/$srcfile" "${binfile}" executable $opts] != "" } {
     untested "failed to compile"
     return -1
index 993f79f29a4b21101081a560a8558ae2f391302b..04887db0dbde28f87009686485f679557eddd561 100644 (file)
@@ -21,8 +21,15 @@ if {![istarget x86_64-*] || ![is_lp64_target]} {
 }
 standard_testfile .S
 
+set opts [list {additional_flags=-nostdlib}]
+
+# Clang's integrated assembler doesn't support .func or .endfunc.
+if { [test_compiler_info clang*] } {
+    lappend opts [list {additional_flags=-fno-integrated-as}]
+}
+
 if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile] \
-        [list {additional_flags=-nostdlib}]]} {
+        $opts]} {
     return -1
 }