summaryrefslogtreecommitdiff
path: root/clang/test/Sema/freemain.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/freemain.c')
-rw-r--r--clang/test/Sema/freemain.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Sema/freemain.c b/clang/test/Sema/freemain.c
new file mode 100644
index 0000000..eed644d
--- /dev/null
+++ b/clang/test/Sema/freemain.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s
+
+// Tests that -ffreestanding disables all special treatment of main().
+
+void* allocate(long size);
+
+void* main(void* context, long size) {
+ if (context) return allocate(size);
+} // expected-warning {{control may reach end of non-void function}}