2016-12-16 06:00:14 +08:00
|
|
|
// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
|
|
|
|
|
Adding Msan support to FreeBSD
Summary:
Enabling the memory sanitizer support for FreeBSD, most of unit tests are compatible.
- Adding fstat and stressor_r interceptors.
- Updating the struct link_map access since most likely the struct Obj_Entry had been updated since.
- Disabling few unit tests until further work is needed (or we can assume it can work in real world code).
Patch by: David CARLIER
Reviewers: vitalybuka, krytarowski
Reviewed By: vitalybuka
Subscribers: eugenis, dim, srhines, emaste, kubamracek, mgorny, fedor.sergeev, hintonda, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43080
llvm-svn: 326644
2018-03-03 19:43:11 +08:00
|
|
|
#ifndef __FreeBSD__
|
2016-12-16 06:00:14 +08:00
|
|
|
#include <utmp.h>
|
Adding Msan support to FreeBSD
Summary:
Enabling the memory sanitizer support for FreeBSD, most of unit tests are compatible.
- Adding fstat and stressor_r interceptors.
- Updating the struct link_map access since most likely the struct Obj_Entry had been updated since.
- Disabling few unit tests until further work is needed (or we can assume it can work in real world code).
Patch by: David CARLIER
Reviewers: vitalybuka, krytarowski
Reviewed By: vitalybuka
Subscribers: eugenis, dim, srhines, emaste, kubamracek, mgorny, fedor.sergeev, hintonda, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43080
llvm-svn: 326644
2018-03-03 19:43:11 +08:00
|
|
|
#endif
|
2016-12-16 06:00:14 +08:00
|
|
|
#include <utmpx.h>
|
|
|
|
#include <sanitizer/msan_interface.h>
|
|
|
|
|
|
|
|
int main(void) {
|
Adding Msan support to FreeBSD
Summary:
Enabling the memory sanitizer support for FreeBSD, most of unit tests are compatible.
- Adding fstat and stressor_r interceptors.
- Updating the struct link_map access since most likely the struct Obj_Entry had been updated since.
- Disabling few unit tests until further work is needed (or we can assume it can work in real world code).
Patch by: David CARLIER
Reviewers: vitalybuka, krytarowski
Reviewed By: vitalybuka
Subscribers: eugenis, dim, srhines, emaste, kubamracek, mgorny, fedor.sergeev, hintonda, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43080
llvm-svn: 326644
2018-03-03 19:43:11 +08:00
|
|
|
#ifndef __FreeBSD__
|
2016-12-16 06:00:14 +08:00
|
|
|
setutent();
|
|
|
|
while (struct utmp *ut = getutent())
|
|
|
|
__msan_check_mem_is_initialized(ut, sizeof(*ut));
|
|
|
|
endutent();
|
Adding Msan support to FreeBSD
Summary:
Enabling the memory sanitizer support for FreeBSD, most of unit tests are compatible.
- Adding fstat and stressor_r interceptors.
- Updating the struct link_map access since most likely the struct Obj_Entry had been updated since.
- Disabling few unit tests until further work is needed (or we can assume it can work in real world code).
Patch by: David CARLIER
Reviewers: vitalybuka, krytarowski
Reviewed By: vitalybuka
Subscribers: eugenis, dim, srhines, emaste, kubamracek, mgorny, fedor.sergeev, hintonda, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43080
llvm-svn: 326644
2018-03-03 19:43:11 +08:00
|
|
|
#endif
|
2016-12-16 06:00:14 +08:00
|
|
|
|
|
|
|
setutxent();
|
|
|
|
while (struct utmpx *utx = getutxent())
|
|
|
|
__msan_check_mem_is_initialized(utx, sizeof(*utx));
|
|
|
|
endutxent();
|
|
|
|
}
|