[clang] 214265b - [NFC] Add test for HasNativeLLVMSupport

Paul Robinson via cfe-commits cfe-commits at lists.llvm.org
Mon May 2 11:12:00 PDT 2022


Author: Paul Robinson
Date: 2022-05-02T11:06:33-07:00
New Revision: 214265bce9dfe3a86d9e8e8869d58ee7eded20fa

URL: https://github.com/llvm/llvm-project/commit/214265bce9dfe3a86d9e8e8869d58ee7eded20fa
DIFF: https://github.com/llvm/llvm-project/commit/214265bce9dfe3a86d9e8e8869d58ee7eded20fa.diff

LOG: [NFC] Add test for HasNativeLLVMSupport

It looks like there used to be a test for this, but the test evolved
in a way that caused the check for the diagnostic to be eliminated.
Add a test that is obviously and specifically for that diagnostic.

Added: 
    clang/test/Driver/native-llvm.c

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/native-llvm.c b/clang/test/Driver/native-llvm.c
new file mode 100644
index 0000000000000..c9543b855bc76
--- /dev/null
+++ b/clang/test/Driver/native-llvm.c
@@ -0,0 +1,5 @@
+// Check that clang reports an error message if -flto without -c is used
+// on a toolchain that is not expecting it (HasNativeLLVMSupport() is false).
+
+// RUN: %clang -### -flto -target x86_64-unknown-unknown %s 2>&1 | FileCheck %s
+// CHECK: error: {{.*}} unable to pass LLVM bit-code files to linker


        


More information about the cfe-commits mailing list