This repository has been archived by the owner on May 21, 2019. It is now read-only.
forked from vadimcn/compiler-rt
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sanitizer] Support most ioctls from /usr/include/sound/.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200544 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
5 changed files
with
516 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// RUN: %clangxx_msan -m64 -O0 -g %s -o %t && %t | ||
// RUN: %clangxx_msan -m64 -O3 -g %s -o %t && %t | ||
|
||
#include <assert.h> | ||
#include <fcntl.h> | ||
#include <sound/asound.h> | ||
#include <stdio.h> | ||
#include <sys/ioctl.h> | ||
#include <sys/socket.h> | ||
#include <unistd.h> | ||
|
||
#include <sanitizer/msan_interface.h> | ||
|
||
int main(int argc, char **argv) { | ||
int fd = open("/dev/snd/controlC0", O_RDONLY); | ||
if (fd < 0) { | ||
printf("Unable to open sound device."); | ||
return 0; | ||
} | ||
snd_ctl_card_info info; | ||
assert(__msan_test_shadow(&info, sizeof(info)) != -1); | ||
assert(ioctl(fd, SNDRV_CTL_IOCTL_CARD_INFO, &info) >= 0); | ||
assert(__msan_test_shadow(&info, sizeof(info)) == -1); | ||
close(fd); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.