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

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 22:05:13 PDT 2024


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

You need too restore the optimization level around this with MSVC.

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


More information about the llvm-commits mailing list