diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-09-19 23:07:12 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-09-19 23:07:12 +0000 |
commit | d191063c6c507aa24bc1d2346b17966aac4a734b (patch) | |
tree | bb102411c87aecf9f1b29db1917c9219d8cb6192 /clang/test/CodeGen/mrtd.c | |
parent | de0253791cfadd186b904f75c406d4fdcbf58899 (diff) | |
download | bcm5719-llvm-d191063c6c507aa24bc1d2346b17966aac4a734b.tar.gz bcm5719-llvm-d191063c6c507aa24bc1d2346b17966aac4a734b.zip |
Follow-up to r214408: Warn on other callee-cleanup functions without prototype too.
According to lore, we used to verifier-fail on:
void __thiscall f();
int main() { f(1); }
So that's fixed now. System headers use prototype-less __stdcall functions,
so make that a warning that's DefaultError -- then it fires on regular code
but is suppressed in system headers.
Since it's used in system headers, we have codegen tests for this; massage
them slightly so that they still compile.
llvm-svn: 218166
Diffstat (limited to 'clang/test/CodeGen/mrtd.c')
-rw-r--r-- | clang/test/CodeGen/mrtd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/CodeGen/mrtd.c b/clang/test/CodeGen/mrtd.c index 8fa7cf02cea..79cd490084f 100644 --- a/clang/test/CodeGen/mrtd.c +++ b/clang/test/CodeGen/mrtd.c @@ -1,4 +1,9 @@ -// RUN: %clang_cc1 -mrtd -triple i386-unknown-unknown -std=c89 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -mrtd -triple i386-unknown-unknown -std=c89 -Wsystem-headers -Wno-error=missing-prototype-for-cc -emit-llvm -o - %s 2>&1 | FileCheck %s + +// prototype-less __stdcall functions are only allowed in system headers. +# 1 "fake_system_header.h" 1 3 4 + +// CHECK: fake_system_header.h:9:3: warning: function with no prototype cannot use stdcall calling convention void baz(int arg); |