eugenis added a comment.

The test should be in CodeGenCXX, and probably called 
"sanitize-dtor-callback.cpp".


================
Comment at: test/CodeGen/sanitize-dtor-usage.cpp:7
@@ +6,3 @@
+  int x_;
+  A() {
+    x_ = 5;
----------------
You probably don't need a lot of this code, like main() function, or A() 
constructor.


================
Comment at: test/CodeGen/sanitize-dtor-usage.cpp:11
@@ +10,3 @@
+  ~A() {
+    // __msan_poison(this, sizeof(*this));
+  }
----------------
remove the comments.

================
Comment at: test/CodeGen/sanitize-dtor-usage.cpp:20
@@ +19,3 @@
+
+// Check that MSan destructor sanitization poisons simple internal attribute
+// DTOR: call void @__sanitizer_dtor_callback
----------------
Add a CHECK-LABEL: test for the function name to make sure the call is in the 
destructor.

You'll probably need -triple=x86_64-pc-linux in the run line so that destructor 
name mangling is consistent.


================
Comment at: test/CodeGen/sanitize-dtor-usage.cpp:22
@@ +21,2 @@
+// DTOR: call void @__sanitizer_dtor_callback
+// CHECK: ret void
----------------
This does not do anything because of --check-prefix=DTOR (CHECK is the default 
prefix that is disabled if you set some other prefix). Add --check-prefix=CHECK.

Test that the function call is not added when building without 
-fsanitize-memory-use-after-dtor.



http://reviews.llvm.org/D11109




_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to