summaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases/Linux/mallopt.cpp
blob: 9ac3c5dc5978846ee9ae3ce541ba8f812df25d59 (plain)
1
2
3
4
5
6
7
8
9
10
// Check that mallopt does not return invalid values (ex. -1).
// RUN: %clangxx -O2 %s -o %t && %run %t
#include <assert.h>
#include <malloc.h>

int main() {
  // Try a random mallopt option, possibly invalid.
  int res = mallopt(-42, 0);
  assert(res == 0 || res == 1);
}