diff options
author | Duncan Sands <baldrick@free.fr> | 2007-12-21 19:16:16 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-12-21 19:16:16 +0000 |
commit | 110c8350394df3222307fbebe608ff9ed88ea487 (patch) | |
tree | 67af4837ccc6c7a87f0bad8e1561bb9ee31a5f52 /test/Transforms | |
parent | 5a6c91a3eceb701396c30dd126079903006c5e0b (diff) | |
download | external_llvm-110c8350394df3222307fbebe608ff9ed88ea487.zip external_llvm-110c8350394df3222307fbebe608ff9ed88ea487.tar.gz external_llvm-110c8350394df3222307fbebe608ff9ed88ea487.tar.bz2 |
Make DAE not wipe out attributes on calls, and not drop
return attributes on the floor. In the case of a call
to a varargs function where the varargs arguments are
being removed, any call attributes on those arguments
need to be dropped. I didn't do this because I plan to
make it illegal to have such attributes (see next patch).
With this change, compiling the gcc filter2 eh test at -O0
and then running opt -std-compile-opts on it results in
a correctly working program (compiling at -O1 or higher
results in the test failing due to a problem with how we
output eh info into the IR).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45285 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll b/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll new file mode 100644 index 0000000..94181f3 --- /dev/null +++ b/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep nounwind | count 2 +; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep signext | count 2 +; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep inreg +; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep zeroext + +@g = global i8 0 + +define internal i8 @foo(i8* inreg %p, i8 signext %y, ... ) zeroext nounwind { + store i8 %y, i8* @g + ret i8 0 +} + +define i32 @bar() { + %A = call i8(i8*, i8, ...)* @foo(i8* inreg null, i8 signext 1, i8 2) zeroext nounwind + ret i32 0 +} |