]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
contrib/gcc-changelog: Detect if same file appears twice
authorTobias Burnus <tobias@codesourcery.com>
Mon, 10 May 2021 12:36:52 +0000 (14:36 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 10 May 2021 12:37:15 +0000 (14:37 +0200)
contrib/ChangeLog:

* gcc-changelog/git_commit.py (Error.__repr__): Add space after the colon.
(GitCommit.check_mentioned_files): Check whether the same file has been
specified multiple times.
* gcc-changelog/test_email.py (TestGccChangelog.test_multi_same_file): New.
* gcc-changelog/test_patches.txt (0001-OpenMP-Fix-SIMT): New test.

contrib/gcc-changelog/git_commit.py
contrib/gcc-changelog/test_email.py
contrib/gcc-changelog/test_patches.txt

index b28f7deac230dda5da91af6515fae56386429afc..d9332cb0c388a94fe0a1a3dc1c8f11267b74d10d 100755 (executable)
@@ -200,7 +200,7 @@ class Error:
     def __repr__(self):
         s = self.message
         if self.line:
-            s += ':"%s"' % self.line
+            s += ': "%s"' % self.line
         return s
 
 
@@ -629,7 +629,12 @@ class GitCommit:
             assert not entry.folder.endswith('/')
             for file in entry.files:
                 if not self.is_changelog_filename(file):
-                    mentioned_files.add(os.path.join(entry.folder, file))
+                    item = os.path.join(entry.folder, file)
+                    if item in mentioned_files:
+                        msg = 'same file specified multiple times'
+                        self.errors.append(Error(msg, file))
+                    else:
+                        mentioned_files.add(item)
             for pattern in entry.file_patterns:
                 mentioned_patterns.append(os.path.join(entry.folder, pattern))
 
index 8abf5c374874ba92210df6580aabe6c3d2b9dc35..d66bf5be4ebadbcf7b5f0fc29d61fa21b10ddc0c 100755 (executable)
@@ -424,3 +424,7 @@ class TestGccChangelog(unittest.TestCase):
     def test_long_filenames(self):
         email = self.from_patch_glob('0001-long-filenames')
         assert not email.errors
+
+    def test_multi_same_file(self):
+        email = self.from_patch_glob('0001-OpenMP-Fix-SIMT')
+        assert email.errors[0].message == 'same file specified multiple times'
index 3f9806dc0765b977d3e744d749f5848ae4c3a9cf..7e4a4b01081af35410678688d1e72667cdcff510 100644 (file)
@@ -3546,3 +3546,32 @@ index 5ad82db1def..53b15f32516 100644
 @@ -1 +1,2 @@
  
 +
+
+=== 0001-OpenMP-Fix-SIMT ===
+From 33b647956caa977d1ae489f9baed9cef70b4f382 Mon Sep 17 00:00:00 2001
+From: Tobias Burnus <tobias@codesourcery.com>
+Date: Fri, 7 May 2021 12:11:51 +0200
+Subject: [PATCH] OpenMP: Fix SIMT for complex/float reduction with && and ||
+
+libgomp/ChangeLog:
+
+       * testsuite/libgomp.c-c++-common/reduction-5.c: New test, testing
+       complex/floating-point || + && reduction with 'omp target'.
+       * testsuite/libgomp.c-c++-common/reduction-5.c: Likewise.
+---
+diff --git a/libgomp/testsuite/libgomp.c-c++-common/reduction-5.c b/libgomp/testsuite/libgomp.c-c++-common/reduction-5.c
+new file mode 100644
+index 00000000000..21540512e23
+--- /dev/null
++++ b/libgomp/testsuite/libgomp.c-c++-common/reduction-5.c
+@@ -0,0 +1,1 @@
++
+diff --git a/libgomp/testsuite/libgomp.c-c++-common/reduction-6.c b/libgomp/testsuite/libgomp.c-c++-common/reduction-6.c
+new file mode 100644
+index 00000000000..21540512e23
+--- /dev/null
++++ b/libgomp/testsuite/libgomp.c-c++-common/reduction-6.c
+@@ -0,0 +1,1 @@
++
+-- 
+2.25.1