diff options
| author | Torok Edwin <edwintorok@gmail.com> | 2009-05-22 06:41:43 +0000 |
|---|---|---|
| committer | Torok Edwin <edwintorok@gmail.com> | 2009-05-22 06:41:43 +0000 |
| commit | a39d69684ac7b0cbb0a2cc67e59665f75fc8f458 (patch) | |
| tree | 6187599d488826d19f8beb894d69d2fe210dbf22 /llvm/test | |
| parent | 0cf811df8245b88a010ce9bf052dba0bb5e915ed (diff) | |
| download | bcm5719-llvm-a39d69684ac7b0cbb0a2cc67e59665f75fc8f458.tar.gz bcm5719-llvm-a39d69684ac7b0cbb0a2cc67e59665f75fc8f458.zip | |
Verify that calling conventions match function prototype.
This only rejects mismatches between target specific calling convention
and C/LLVM specific calling convention.
There are too many fastcc/C, coldcc/cc42 mismatches in the testsuite, these are
not reject by the verifier.
llvm-svn: 72248
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Assembler/2009-05-22-CC.ll | 9 | ||||
| -rw-r--r-- | llvm/test/Verifier/2009-05-22-CC.ll | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Assembler/2009-05-22-CC.ll b/llvm/test/Assembler/2009-05-22-CC.ll new file mode 100644 index 00000000000..ba80d64ac28 --- /dev/null +++ b/llvm/test/Assembler/2009-05-22-CC.ll @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s + +; Verify that calls with correct calling conv are accepted +declare x86_stdcallcc i32 @re_string_construct(i8* inreg %pstr, i8* inreg %str, i32 inreg %len, i8* %trans, i32 %icase, i8* %dfa); +define void @main() { +entry: + %0 = call x86_stdcallcc i32 (...)* bitcast (i32 (i8*, i8*, i32, i8*, i32, i8*)* @re_string_construct to i32 (...)*)(i32 inreg 0, i32 inreg 0, i32 inreg 0, i32 0, i32 0, i8* inttoptr (i32 673194176 to i8*)); + ret void +} diff --git a/llvm/test/Verifier/2009-05-22-CC.ll b/llvm/test/Verifier/2009-05-22-CC.ll new file mode 100644 index 00000000000..7775dede03a --- /dev/null +++ b/llvm/test/Verifier/2009-05-22-CC.ll @@ -0,0 +1,11 @@ +; RUN: not llvm-as < %s |& grep {Calling convention does not match function signature} +; PR 4239 + +; Verify that the calling convention on the call instruction matches the +; declared calling convention +declare x86_stdcallcc i32 @re_string_construct(i8* inreg %pstr, i8* inreg %str, i32 inreg %len, i8* %trans, i32 %icase, i8* %dfa); +define void @main() { +entry: + %0 = call i32 (...)* bitcast (i32 (i8*, i8*, i32, i8*, i32, i8*)* @re_string_construct to i32 (...)*)(i32 inreg 0, i32 inreg 0, i32 inreg 0, i32 0, i32 0, i8* inttoptr (i32 673194176 to i8*)) + ret void +} |

