[PATCH] D79894: [clang][slh] Add test for SLH feature checking macro

Zola Bridges via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 15 12:32:24 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG18a855da431e: [clang][slh] Add test for SLH feature checking macro (authored by zbrid).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79894/new/

https://reviews.llvm.org/D79894

Files:
  clang/test/Lexer/has_feature_speculative_load_hardening.cpp


Index: clang/test/Lexer/has_feature_speculative_load_hardening.cpp
===================================================================
--- /dev/null
+++ clang/test/Lexer/has_feature_speculative_load_hardening.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang -E -mspeculative-load-hardening %s -o - | FileCheck --check-prefix=CHECK-SLH %s
+// RUN: %clang -E -mno-speculative-load-hardening %s -o - | FileCheck --check-prefix=CHECK-NOSLH %s
+// RUN: %clang -E %s -o - | FileCheck --check-prefix=CHECK-DEFAULT %s
+
+#if __has_feature(speculative_load_hardening)
+int SpeculativeLoadHardeningEnabled();
+#else
+int SpeculativeLoadHardeningDisabled();
+#endif
+
+// CHECK-SLH: SpeculativeLoadHardeningEnabled
+
+// CHECK-NOSLH: SpeculativeLoadHardeningDisabled
+
+// CHECK-DEFAULT: SpeculativeLoadHardeningDisabled


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79894.264315.patch
Type: text/x-patch
Size: 798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200515/cfa1de78/attachment.bin>


More information about the cfe-commits mailing list