blob: 375f42499cbc8e0b973703c03e59fbce51e9b1eb [file] [log] [blame]
Jakob Stoklund Olesenbbf33b32010-05-11 18:54:45 +00001; RUN-XFAIL: llc < %s -O0 -regalloc=local | FileCheck %s
2; RUN: llc < %s -O0 -regalloc=fast | FileCheck %s
Jakob Stoklund Olesen51bfd452010-05-05 23:07:41 +00003; PR6520
Nick Lewycky403d3122010-05-07 01:45:38 +00004
Jakob Stoklund Olesen51bfd452010-05-05 23:07:41 +00005target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
6target triple = "i386-apple-darwin10.0.0"
7
8%0 = type { i8*, i8*, i32 }
9
10define i8* @func() nounwind ssp {
11entry:
12 %retval = alloca i8*, align 4 ; <i8**> [#uses=2]
13 %ret = alloca i8*, align 4 ; <i8**> [#uses=2]
14 %p = alloca i8*, align 4 ; <i8**> [#uses=1]
15 %t = alloca i32, align 4 ; <i32*> [#uses=1]
16; The earlyclobber $1 should only appear once. It should not be shared.
17; CHECK: deafbeef, [[REG:%e.x]]
18; CHECK-NOT: [[REG]]
19; CHECK: InlineAsm End
20 %0 = call %0 asm "mov $$0xdeafbeef, $1\0A\09mov $$0xcafebabe, $0\0A\09mov $0, $2\0A\09", "=&r,=&r,=&{cx},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0 ; <%0> [#uses=3]
21 %asmresult = extractvalue %0 %0, 0 ; <i8*> [#uses=1]
22 %asmresult1 = extractvalue %0 %0, 1 ; <i8*> [#uses=1]
23 %asmresult2 = extractvalue %0 %0, 2 ; <i32> [#uses=1]
24 store i8* %asmresult, i8** %ret
25 store i8* %asmresult1, i8** %p
26 store i32 %asmresult2, i32* %t
27 %tmp = load i8** %ret ; <i8*> [#uses=1]
28 store i8* %tmp, i8** %retval
29 %1 = load i8** %retval ; <i8*> [#uses=1]
30 ret i8* %1
31}
32
33!0 = metadata !{i32 79}