jfb created this revision.
jfb added a reviewer: EricWF.
jfb added a subscriber: cfe-commits.

The ABI version flag should fix the error.

https://reviews.llvm.org/D23041

Files:
  test/libcxx/atomics/atomics.align/align.pass.sh.cpp
  test/libcxx/test/config.py

Index: test/libcxx/test/config.py
===================================================================
--- test/libcxx/test/config.py
+++ test/libcxx/test/config.py
@@ -306,6 +306,11 @@
         # Configure extra flags
         compile_flags_str = self.get_lit_conf('compile_flags', '')
         self.cxx.compile_flags += shlex.split(compile_flags_str)
+        # GCC ABI version 6 first appeared in G++ 4.7, corrects the mangling of
+        # template argument packs, which is required for the atomics.align 
test.
+        abi_flag = '-fabi-version=6'
+        if self.cxx.hasCompileFlag(abi_flag):
+            self.cxx.compile_flags += [abi_flag]
 
     def configure_default_compile_flags(self):
         # Try and get the std version from the command line. Fall back to
Index: test/libcxx/atomics/atomics.align/align.pass.sh.cpp
===================================================================
--- test/libcxx/atomics/atomics.align/align.pass.sh.cpp
+++ test/libcxx/atomics/atomics.align/align.pass.sh.cpp
@@ -11,10 +11,6 @@
 // REQUIRES: libatomic
 // RUN: %build -latomic
 // RUN: %run
-//
-// GCC currently fails because it needs -fabi-version=6 to fix mangling of
-// std::atomic when used with __attribute__((vector(X))).
-// XFAIL: gcc
 
 // <atomic>
 


Index: test/libcxx/test/config.py
===================================================================
--- test/libcxx/test/config.py
+++ test/libcxx/test/config.py
@@ -306,6 +306,11 @@
         # Configure extra flags
         compile_flags_str = self.get_lit_conf('compile_flags', '')
         self.cxx.compile_flags += shlex.split(compile_flags_str)
+        # GCC ABI version 6 first appeared in G++ 4.7, corrects the mangling of
+        # template argument packs, which is required for the atomics.align test.
+        abi_flag = '-fabi-version=6'
+        if self.cxx.hasCompileFlag(abi_flag):
+            self.cxx.compile_flags += [abi_flag]
 
     def configure_default_compile_flags(self):
         # Try and get the std version from the command line. Fall back to
Index: test/libcxx/atomics/atomics.align/align.pass.sh.cpp
===================================================================
--- test/libcxx/atomics/atomics.align/align.pass.sh.cpp
+++ test/libcxx/atomics/atomics.align/align.pass.sh.cpp
@@ -11,10 +11,6 @@
 // REQUIRES: libatomic
 // RUN: %build -latomic
 // RUN: %run
-//
-// GCC currently fails because it needs -fabi-version=6 to fix mangling of
-// std::atomic when used with __attribute__((vector(X))).
-// XFAIL: gcc
 
 // <atomic>
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to