================
@@ -0,0 +1,42 @@
+// RUN: %clang_cc1 %s -DTEST_EMPTY_COPYRIGHT -triple powerpc-ibm-aix -verify
+// RUN: %clang_cc1 %s -DTEST_OTHER_COMMENT_KINDS -triple powerpc-ibm-aix 
-verify
+// RUN: %clang_cc1 %s -triple powerpc-ibm-aix -emit-llvm -disable-llvm-passes 
-o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple powerpc-ibm-aix -verify
+
+// RUN: %clang_cc1 %s -DTEST_EMPTY_COPYRIGHT -triple powerpc64-ibm-aix -verify
+// RUN: %clang_cc1 %s -DTEST_OTHER_COMMENT_KINDS -triple powerpc64-ibm-aix 
-verify
+// RUN: %clang_cc1 %s -triple powerpc64-ibm-aix -emit-llvm 
-disable-llvm-passes -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple powerpc64-ibm-aix -verify
+
+#ifdef TEST_EMPTY_COPYRIGHT
+
+// 1. Verify no diagnostics for empty copyright string
+#pragma comment(copyright, "") // expected-no-diagnostics
+int main() {return 0; }
+
+#elif defined(TEST_OTHER_COMMENT_KINDS)
+
+// 2. Verify warnings for lib/linker and silent ignore for others
+#pragma comment(lib, "m") // expected-warning {{'#pragma comment lib' ignored}}
+#pragma comment(linker, "foo") // expected-warning {{'#pragma comment linker' 
ignored}}
+
+// These are recognized but ignored in CodeGen
----------------
tonykuttai wrote:

This is the existing behaviour of these pragma comment kinds. 
`compiler, exestr, user` kinds are ignored by other targets as well in 
`clang/lib/CodeGen/CodeGenModule.cpp`

https://github.com/llvm/llvm-project/pull/178184
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to