Daniel Sanders | 753e176 | 2014-02-13 14:44:26 +0000 | [diff] [blame] | 1 | ; RUN: llc -O2 -no-integrated-as < %s | FileCheck %s |
Eric Christopher | 0cb6fd9 | 2013-01-11 18:12:39 +0000 | [diff] [blame] | 2 | |
| 3 | @G = common global i32 0, align 4 |
| 4 | |
| 5 | define i32 @foo(i8* %p) nounwind uwtable { |
| 6 | entry: |
| 7 | %p.addr = alloca i8*, align 8 |
| 8 | %rv = alloca i32, align 4 |
| 9 | store i8* %p, i8** %p.addr, align 8 |
| 10 | store i32 0, i32* @G, align 4 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 11 | %0 = load i8*, i8** %p.addr, align 8 |
Eric Christopher | 0cb6fd9 | 2013-01-11 18:12:39 +0000 | [diff] [blame] | 12 | ; CHECK: blah |
| 13 | %1 = call i32 asm "blah", "=r,r,~{memory}"(i8* %0) nounwind |
| 14 | ; CHECK: @G |
| 15 | store i32 %1, i32* %rv, align 4 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 16 | %2 = load i32, i32* %rv, align 4 |
| 17 | %3 = load i32, i32* @G, align 4 |
Eric Christopher | 0cb6fd9 | 2013-01-11 18:12:39 +0000 | [diff] [blame] | 18 | %add = add nsw i32 %2, %3 |
| 19 | ret i32 %add |
| 20 | } |
| 21 | |