summaryrefslogtreecommitdiff
path: root/test/ubsan/TestCases/Misc/missing_return.cpp
blob: 5c5b286f1a65fd2a10aca00913443a6bf7e56125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// RUN: %clangxx -fsanitize=return %gmlt %s -O3 -o %t
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %env_ubsan_opts=print_stacktrace=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-STACKTRACE

// CHECK: missing_return.cpp:[[@LINE+1]]:5: runtime error: execution reached the end of a value-returning function without returning a value
int f() {
// CHECK-STACKTRACE: #0 {{.*}}f{{.*}}missing_return.cpp:[[@LINE-1]]
}

int main(int, char **argv) {
  return f();
}