diff options
Diffstat (limited to 'lib/ubsan/lit_tests/TestCases/Misc/missing_return.cpp')
-rw-r--r-- | lib/ubsan/lit_tests/TestCases/Misc/missing_return.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ubsan/lit_tests/TestCases/Misc/missing_return.cpp b/lib/ubsan/lit_tests/TestCases/Misc/missing_return.cpp new file mode 100644 index 000000000000..7da238e25dca --- /dev/null +++ b/lib/ubsan/lit_tests/TestCases/Misc/missing_return.cpp @@ -0,0 +1,9 @@ +// RUN: %clangxx -fsanitize=return %s -O3 -o %t && %t 2>&1 | FileCheck %s + +// CHECK: missing_return.cpp:4:5: runtime error: execution reached the end of a value-returning function without returning a value +int f() { +} + +int main(int, char **argv) { + return f(); +} |