brintos

brintos / llvm-project-archived public Read only

0
0
Text · 652 B · 7206686 Raw
22 lines · cpp
1// REQUIRES: android2 3// Tests that ubsan can detect errors on Android if libc appears before the4// runtime in the library search order, which means that we cannot intercept5// symbols.6 7// RUN: rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir8// RUN: %clangxx %p/Inputs/no-interception-dso.c -fsanitize=undefined -fPIC -shared -o %dynamiclib %ld_flags_rpath_so9 10// Make sure that libc is first in DT_NEEDED.11// RUN: %clangxx %s -lc -o %t.dir/EXE %ld_flags_rpath_exe12// RUN: %run %t.dir/EXE 2>&1 | FileCheck %s13 14#include <limits.h>15 16int dso_function(int);17 18int main(int argc, char **argv) {19  // CHECK: signed integer overflow20  dso_function(INT_MAX);21}22