-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[clang][test][NFC] Use -fdriver-only over /dev/null #135255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Tests should avoid using platform dependent behavior, like /dev/null when possible. -fdriver-only should stop clang even earlier, and avoid any non-diagnostic output.
|
@llvm/pr-subscribers-clang Author: Paul Kirth (ilovepi) ChangesTests should avoid using platform dependent behavior, like /dev/null Full diff: https://github.com/llvm/llvm-project/pull/135255.diff 1 Files Affected:
diff --git a/clang/test/Driver/openacc-no-cir.c b/clang/test/Driver/openacc-no-cir.c
index 891f175a001bb..5fa1e4e0c809f 100644
--- a/clang/test/Driver/openacc-no-cir.c
+++ b/clang/test/Driver/openacc-no-cir.c
@@ -1,6 +1,6 @@
-// RUN: %clang -fopenacc -S %s -o /dev/null 2>&1 | FileCheck %s -check-prefix=ERROR
-// RUN: %clang -fclangir -fopenacc -S %s -o /dev/null 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR
-// RUN: %clang -fopenacc -fclangir -S %s -o /dev/null 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR
+// RUN: %clang -fopenacc -S %s -o -fdriver-only 2>&1 | FileCheck %s -check-prefix=ERROR
+// RUN: %clang -fclangir -fopenacc -S %s -fdriver-only 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR
+// RUN: %clang -fopenacc -fclangir -S %s -fdriver-only 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR
// ERROR: OpenACC directives will result in no runtime behavior; use -fclangir to enable runtime effect
// NOERROR-NOT: OpenACC directives
|
|
@llvm/pr-subscribers-clang-driver Author: Paul Kirth (ilovepi) ChangesTests should avoid using platform dependent behavior, like /dev/null Full diff: https://github.com/llvm/llvm-project/pull/135255.diff 1 Files Affected:
diff --git a/clang/test/Driver/openacc-no-cir.c b/clang/test/Driver/openacc-no-cir.c
index 891f175a001bb..5fa1e4e0c809f 100644
--- a/clang/test/Driver/openacc-no-cir.c
+++ b/clang/test/Driver/openacc-no-cir.c
@@ -1,6 +1,6 @@
-// RUN: %clang -fopenacc -S %s -o /dev/null 2>&1 | FileCheck %s -check-prefix=ERROR
-// RUN: %clang -fclangir -fopenacc -S %s -o /dev/null 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR
-// RUN: %clang -fopenacc -fclangir -S %s -o /dev/null 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR
+// RUN: %clang -fopenacc -S %s -o -fdriver-only 2>&1 | FileCheck %s -check-prefix=ERROR
+// RUN: %clang -fclangir -fopenacc -S %s -fdriver-only 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR
+// RUN: %clang -fopenacc -fclangir -S %s -fdriver-only 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR
// ERROR: OpenACC directives will result in no runtime behavior; use -fclangir to enable runtime effect
// NOERROR-NOT: OpenACC directives
|
erichkeane
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one shouldn't work. We explicitly don't diagnose this in non-codegen invocations.
| // RUN: %clang -fopenacc -S %s -o /dev/null 2>&1 | FileCheck %s -check-prefix=ERROR | ||
| // RUN: %clang -fclangir -fopenacc -S %s -o /dev/null 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR | ||
| // RUN: %clang -fopenacc -fclangir -S %s -o /dev/null 2>&1 | FileCheck %s --allow-empty -check-prefix=NOERROR | ||
| // RUN: %clang -fopenacc -S %s -o -fdriver-only 2>&1 | FileCheck %s -check-prefix=ERROR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-o -fdriver-only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, probably why the test passed 🤦
|
/dev/null works on Windows If you are adjusting the test, also insert |
That's surprising, but if that's the case, I don't think this patch makes much sense. |

Tests should avoid using platform dependent behavior, like /dev/null
when possible. -fdriver-only should stop clang even earlier, and avoid
any non-diagnostic output.