xref: /llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/mallopt.cpp (revision f9dd0166f1e28632a147223642ba6eead49ba955)
1 // Check that mallopt does not return invalid values (ex. -1).
2 // RUN: %clangxx -O2 %s -o %t && %run %t
3 
4 // Investigate why it fails with NDK 21.
5 // UNSUPPORTED: android
6 
7 #include <assert.h>
8 #include <malloc.h>
9 
main()10 int main() {
11   // Try a random mallopt option, possibly invalid.
12   int res = mallopt(-42, 0);
13   assert(res == 0 || res == 1);
14 }
15