aboutsummaryrefslogtreecommitdiff
path: root/test/ubsan/TestCases/Misc/missing_return.cpp
blob: fe8c8bae603d951fcb27e765ea67dd6c6a6bfcbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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
// Error message does not exact what expected
// XFAIL: openbsd

// 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();
}