Joel Jones | 9e02e2c | 2012-05-18 16:24:01 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -simplify-libcalls -S | FileCheck %s |
Nick Lewycky | 4c49841 | 2009-02-13 15:31:46 +0000 | [diff] [blame] | 2 | |
Nick Lewycky | 02b6a6a | 2009-02-13 17:08:33 +0000 | [diff] [blame] | 3 | ; Test that we add nocapture to the declaration, and to the second call only. |
Nick Lewycky | 4c49841 | 2009-02-13 15:31:46 +0000 | [diff] [blame] | 4 | |
Joel Jones | 9e02e2c | 2012-05-18 16:24:01 +0000 | [diff] [blame] | 5 | ; CHECK: declare float @strtol(i8*, i8** nocapture, i32) nounwind |
Nick Lewycky | 02b6a6a | 2009-02-13 17:08:33 +0000 | [diff] [blame] | 6 | declare float @strtol(i8* %s, i8** %endptr, i32 %base) |
Nick Lewycky | 4c49841 | 2009-02-13 15:31:46 +0000 | [diff] [blame] | 7 | |
| 8 | define void @foo(i8* %x, i8** %endptr) { |
Joel Jones | 9e02e2c | 2012-05-18 16:24:01 +0000 | [diff] [blame] | 9 | ; CHECK: call float @strtol(i8* %x, i8** %endptr, i32 10) |
Nick Lewycky | 02b6a6a | 2009-02-13 17:08:33 +0000 | [diff] [blame] | 10 | call float @strtol(i8* %x, i8** %endptr, i32 10) |
Joel Jones | 9e02e2c | 2012-05-18 16:24:01 +0000 | [diff] [blame] | 11 | ; CHECK: %2 = call float @strtol(i8* nocapture %x, i8** null, i32 10) |
Nick Lewycky | 02b6a6a | 2009-02-13 17:08:33 +0000 | [diff] [blame] | 12 | call float @strtol(i8* %x, i8** null, i32 10) |
Nick Lewycky | 4c49841 | 2009-02-13 15:31:46 +0000 | [diff] [blame] | 13 | ret void |
| 14 | } |