[compiler-rt] Test fixups for MSVC. (PR #109887)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 03:32:32 PDT 2024


================
@@ -2,12 +2,18 @@
 // RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll
 // RUN: not %run %t %t.dll 2>&1 | FileCheck %s
 
+#include "../defines.h"
+
 struct C {
   int x;
   ~C() {}
 };
 
-int __attribute__((noinline, optnone)) hide(int x) { return x; }
+int ATTRIBUTE_NOINLINE
+#if __clang__ || !defined(_MSC_VER)
----------------
mstorsjo wrote:

Yeah I think we in general would prefer to use `defined()` rather than relying on expansion to zero (although I'm not sure if we have a written down policy about it), so the code would be clean for `-Wundef` too.

https://github.com/llvm/llvm-project/pull/109887


More information about the llvm-commits mailing list