aboutsummaryrefslogtreecommitdiff
path: root/test/Sema
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-08-15 02:09:25 +0000
committerJohn McCall <rjmccall@apple.com>2009-08-15 02:09:25 +0000
commit07a5c22bb6fb0674c95205ae189365bf8e1b695e (patch)
tree65165508917e7a1e73b1edf3238c547bc1818744 /test/Sema
parent2cff7d16fe58e6d6447ec9cad2af083beb20d6b5 (diff)
Disable all recognition of main() in -ffreestanding. Addresses bug #4720.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r--test/Sema/freemain.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Sema/freemain.c b/test/Sema/freemain.c
new file mode 100644
index 0000000000..a2364df259
--- /dev/null
+++ b/test/Sema/freemain.c
@@ -0,0 +1,9 @@
+// RUN: clang-cc -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}}