[PATCH] D64653: clang/test/Driver/fsanitize.c: Fix -fsanitize=vptr using default target

James Nagurne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 11:25:52 PDT 2019


JamesNagurne created this revision.
JamesNagurne added a reviewer: MaskRay.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

test/Driver/fsanitize.c: Fix -fsanitize=vptr using default target

In revision rL365872 <https://reviews.llvm.org/rL365872>, a line containing '-target x86_64-linux-gnu' along
with '-fsanitize=vptr' was modified to only contain the -fsanitize option.

The default implementation of getSupportedSanitizers isn't able to turn
on the vptr sanitizer, and thus, any platform that runs this test will
fail with the error:

  clang: error: unsupported option '-fsanitize=vptr' for target '<target>'


Repository:
  rC Clang

https://reviews.llvm.org/D64653

Files:
  clang/test/Driver/fsanitize.c


Index: clang/test/Driver/fsanitize.c
===================================================================
--- clang/test/Driver/fsanitize.c
+++ clang/test/Driver/fsanitize.c
@@ -97,7 +97,7 @@
 // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-TRAP-UNDEF
 // CHECK-VPTR-TRAP-UNDEF: error: invalid argument '-fsanitize=vptr' not allowed with '-fsanitize-trap=undefined'
 
-// RUN: %clang -fsanitize=vptr -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI
 // CHECK-VPTR-NO-RTTI: '-fsanitize=vptr' not allowed with '-fno-rtti'
 
 // RUN: %clang -fsanitize=undefined -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-NO-RTTI


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64653.209543.patch
Type: text/x-patch
Size: 884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190712/11050f86/attachment-0001.bin>


More information about the cfe-commits mailing list