[PATCH] D27654: Stop intercepting mallinfo and mallopt on FreeBSD

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 8 09:02:17 PST 2017


joerg added inline comments.


================
Comment at: test/asan/TestCases/mallinfo-mallopt.cpp:4
+// RUN: %clang_asan %s -o %t
+// XFAIL: freebsd
+
----------------
dim wrote:
> kcc wrote:
> > hm. is freebsd the only platform where this will fail? 
> > What about other non-linux OSes? 
> Indeed, probably better to make this test succeed on Linux only.  Is there any way to express `XFAIL: !linux` ?
My suggestion would be to do conditionalize the main function, i.e.

```
#if __glibc__
  mallinfo();
  mallopt();
#else
  void non_existant_function(void);
  non_existant_function();
#endif
```

and just check for linking error on all platforms.


================
Comment at: test/asan/TestCases/mallinfo-mallopt.cpp:7
+int mallinfo();
+int mallopt();
+
----------------
Can you make those proper protypes?


https://reviews.llvm.org/D27654





More information about the llvm-commits mailing list