[clang] [driver] Only check for unused plugin options (PR #91522)

2024-05-08 Thread Fangrui Song via cfe-commits

https://github.com/MaskRay approved this pull request.

Consider use a test tag, e.g. `[Driver,test]`

https://github.com/llvm/llvm-project/pull/91522
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [driver] Only check for unused plugin options (PR #91522)

2024-05-08 Thread Hubert Tong via cfe-commits

https://github.com/hubert-reinterpretcast approved this pull request.

LGTM!

https://github.com/llvm/llvm-project/pull/91522
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [driver] Only check for unused plugin options (PR #91522)

2024-05-08 Thread Jake Egan via cfe-commits

https://github.com/jakeegan updated 
https://github.com/llvm/llvm-project/pull/91522

>From 7684f9e6f99c30287f2822152dc83367a934d8b6 Mon Sep 17 00:00:00 2001
From: Jake Egan 
Date: Wed, 8 May 2024 15:09:46 -0400
Subject: [PATCH 1/2] [driver] Only check for unused plugin options

This fixes matching `clang: error: argument unused during compilation: 
'-Werror' [-Werror,-Wunused-command-line-argument]` on AIX.
---
 clang/test/Driver/plugin-driver-args.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/test/Driver/plugin-driver-args.cpp 
b/clang/test/Driver/plugin-driver-args.cpp
index 6f0e6e2ba7525..7667cc4ce7b00 100644
--- a/clang/test/Driver/plugin-driver-args.cpp
+++ b/clang/test/Driver/plugin-driver-args.cpp
@@ -23,5 +23,5 @@
 
 // Plugins are only relevant for the -cc1 phase. No warning should be raised
 // when only using the assembler. See GH #88173.
-// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Werror -x assembler %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PLUGIN-ASM
-// CHECK-PLUGIN-ASM-NOT: argument unused during compilation
+// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Wunused-command-line-argument -x assembler %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-PLUGIN-ASM
+// CHECK-PLUGIN-ASM-NOT: argument unused during compilation: 
'-f{{[a-z-]*-plugin[^']*}}'

>From 223b76b9419db53286b3b5bdc74de985c1d7b794 Mon Sep 17 00:00:00 2001
From: Jake Egan 
Date: Wed, 8 May 2024 20:51:43 -0400
Subject: [PATCH 2/2] Check for -fplugin*

Co-authored-by: Hubert Tong 
---
 clang/test/Driver/plugin-driver-args.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/Driver/plugin-driver-args.cpp 
b/clang/test/Driver/plugin-driver-args.cpp
index 7667cc4ce7b00..6efd859f9d085 100644
--- a/clang/test/Driver/plugin-driver-args.cpp
+++ b/clang/test/Driver/plugin-driver-args.cpp
@@ -24,4 +24,4 @@
 // Plugins are only relevant for the -cc1 phase. No warning should be raised
 // when only using the assembler. See GH #88173.
 // RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Wunused-command-line-argument -x assembler %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-PLUGIN-ASM
-// CHECK-PLUGIN-ASM-NOT: argument unused during compilation: 
'-f{{[a-z-]*-plugin[^']*}}'
+// CHECK-PLUGIN-ASM-NOT: argument unused during compilation: 
'-f{{[a-z-]*plugin[^']*}}'

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [driver] Only check for unused plugin options (PR #91522)

2024-05-08 Thread Hubert Tong via cfe-commits


@@ -23,5 +23,5 @@
 
 // Plugins are only relevant for the -cc1 phase. No warning should be raised
 // when only using the assembler. See GH #88173.
-// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Werror -x assembler %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PLUGIN-ASM
-// CHECK-PLUGIN-ASM-NOT: argument unused during compilation
+// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Wunused-command-line-argument -x assembler %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-PLUGIN-ASM
+// CHECK-PLUGIN-ASM-NOT: argument unused during compilation: 
'-f{{[a-z-]*-plugin[^']*}}'

hubert-reinterpretcast wrote:

Sorry for my mistake "offline"; we want to catch `-fplugin*` too:
```suggestion
// CHECK-PLUGIN-ASM-NOT: argument unused during compilation: 
'-f{{[a-z-]*plugin[^']*}}'
```

https://github.com/llvm/llvm-project/pull/91522
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [driver] Only check for unused plugin options (PR #91522)

2024-05-08 Thread via cfe-commits

llvmbot wrote:



@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Jake Egan (jakeegan)


Changes

This fixes matching `clang: error: argument unused during compilation: 
'-Werror' [-Werror,-Wunused-command-line-argument]` on AIX.

---
Full diff: https://github.com/llvm/llvm-project/pull/91522.diff


1 Files Affected:

- (modified) clang/test/Driver/plugin-driver-args.cpp (+2-2) 


``diff
diff --git a/clang/test/Driver/plugin-driver-args.cpp 
b/clang/test/Driver/plugin-driver-args.cpp
index 6f0e6e2ba7525..7667cc4ce7b00 100644
--- a/clang/test/Driver/plugin-driver-args.cpp
+++ b/clang/test/Driver/plugin-driver-args.cpp
@@ -23,5 +23,5 @@
 
 // Plugins are only relevant for the -cc1 phase. No warning should be raised
 // when only using the assembler. See GH #88173.
-// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Werror -x assembler %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PLUGIN-ASM
-// CHECK-PLUGIN-ASM-NOT: argument unused during compilation
+// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Wunused-command-line-argument -x assembler %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-PLUGIN-ASM
+// CHECK-PLUGIN-ASM-NOT: argument unused during compilation: 
'-f{{[a-z-]*-plugin[^']*}}'

``




https://github.com/llvm/llvm-project/pull/91522
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [driver] Only check for unused plugin options (PR #91522)

2024-05-08 Thread Jake Egan via cfe-commits

https://github.com/jakeegan created 
https://github.com/llvm/llvm-project/pull/91522

This fixes matching `clang: error: argument unused during compilation: 
'-Werror' [-Werror,-Wunused-command-line-argument]` on AIX.

>From 7684f9e6f99c30287f2822152dc83367a934d8b6 Mon Sep 17 00:00:00 2001
From: Jake Egan 
Date: Wed, 8 May 2024 15:09:46 -0400
Subject: [PATCH] [driver] Only check for unused plugin options

This fixes matching `clang: error: argument unused during compilation: 
'-Werror' [-Werror,-Wunused-command-line-argument]` on AIX.
---
 clang/test/Driver/plugin-driver-args.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/test/Driver/plugin-driver-args.cpp 
b/clang/test/Driver/plugin-driver-args.cpp
index 6f0e6e2ba7525..7667cc4ce7b00 100644
--- a/clang/test/Driver/plugin-driver-args.cpp
+++ b/clang/test/Driver/plugin-driver-args.cpp
@@ -23,5 +23,5 @@
 
 // Plugins are only relevant for the -cc1 phase. No warning should be raised
 // when only using the assembler. See GH #88173.
-// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Werror -x assembler %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PLUGIN-ASM
-// CHECK-PLUGIN-ASM-NOT: argument unused during compilation
+// RUN: %clang -c -fpass-plugin=bar.so -fplugin=bar.so -fplugin-arg-bar-option 
-Wunused-command-line-argument -x assembler %s -### 2>&1 | FileCheck %s 
--check-prefix=CHECK-PLUGIN-ASM
+// CHECK-PLUGIN-ASM-NOT: argument unused during compilation: 
'-f{{[a-z-]*-plugin[^']*}}'

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits