1
- ; RUN: llc < %s | FileCheck %s
2
- ; ModuleID = 'asm.c'
3
- target 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"
4
- target triple = "i386-apple-darwin9.6"
1
+ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2
+ ; RUN: llc -mtriple=i386-apple-darwin9.6 < %s | FileCheck %s --check-prefixes=CHECK,X86
3
+ ; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s --check-prefixes=CHECK,X64
5
4
6
5
define i32 @test1 () nounwind {
7
- entry:
8
6
; CHECK-LABEL: test1:
9
- ; CHECK: movw %gs:6, %ax
7
+ ; CHECK: ## %bb.0: ## %entry
8
+ ; CHECK-NEXT: ## InlineAsm Start
9
+ ; CHECK-NEXT: movw %gs:6, %ax
10
+ ; CHECK-NEXT: ## InlineAsm End
11
+ ; CHECK-NEXT: movzwl %ax, %eax
12
+ ; CHECK-NEXT: ret{{[l|q]}}
13
+ entry:
10
14
%asmtmp.i = tail call i16 asm "movw\09 %gs:${1:a}, ${0:w}" , "=r,ir,~{dirflag},~{fpsr},~{flags}" (i32 6 ) nounwind ; <i16> [#uses=1]
11
15
%0 = zext i16 %asmtmp.i to i32 ; <i32> [#uses=1]
12
16
ret i32 %0
13
17
}
14
18
15
19
define zeroext i16 @test2 (i32 %address ) nounwind {
20
+ ; X86-LABEL: test2:
21
+ ; X86: ## %bb.0: ## %entry
22
+ ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
23
+ ; X86-NEXT: ## InlineAsm Start
24
+ ; X86-NEXT: movw %gs:(%eax), %ax
25
+ ; X86-NEXT: ## InlineAsm End
26
+ ; X86-NEXT: movzwl %ax, %eax
27
+ ; X86-NEXT: retl
28
+ ;
29
+ ; X64-LABEL: test2:
30
+ ; X64: ## %bb.0: ## %entry
31
+ ; X64-NEXT: ## InlineAsm Start
32
+ ; X64-NEXT: movw %gs:(%edi), %ax
33
+ ; X64-NEXT: ## InlineAsm End
34
+ ; X64-NEXT: movzwl %ax, %eax
35
+ ; X64-NEXT: retq
16
36
entry:
17
- ; CHECK-LABEL: test2:
18
- ; CHECK: movw %gs:(%eax), %ax
19
37
%asmtmp = tail call i16 asm "movw\09 %gs:${1:a}, ${0:w}" , "=r,ir,~{dirflag},~{fpsr},~{flags}" (i32 %address ) nounwind ; <i16> [#uses=1]
20
38
ret i16 %asmtmp
21
39
}
@@ -24,18 +42,41 @@ entry:
24
42
@y = common global i32 0 ; <ptr> [#uses=3]
25
43
26
44
define void @test3 () nounwind {
45
+ ; X86-LABEL: test3:
46
+ ; X86: ## %bb.0: ## %entry
47
+ ; X86-NEXT: ## InlineAsm Start
48
+ ; X86-NEXT: movl _n, %eax
49
+ ; X86-NEXT: ## InlineAsm End
50
+ ; X86-NEXT: retl
51
+ ;
52
+ ; X64-LABEL: test3:
53
+ ; X64: ## %bb.0: ## %entry
54
+ ; X64-NEXT: ## InlineAsm Start
55
+ ; X64-NEXT: movl _n(%rip), %eax
56
+ ; X64-NEXT: ## InlineAsm End
57
+ ; X64-NEXT: retq
27
58
entry:
28
- ; CHECK-LABEL: test3:
29
- ; CHECK: movl _n, %eax
30
59
call void asm sideeffect "movl ${0:a}, %eax" , "ir,~{dirflag},~{fpsr},~{flags},~{eax}" (ptr @n ) nounwind
31
60
ret void
32
61
}
33
62
34
63
define void @test4 () nounwind {
64
+ ; X86-LABEL: test4:
65
+ ; X86: ## %bb.0: ## %entry
66
+ ; X86-NEXT: movl L_y$non_lazy_ptr, %ecx
67
+ ; X86-NEXT: ## InlineAsm Start
68
+ ; X86-NEXT: movl (%ecx), %eax
69
+ ; X86-NEXT: ## InlineAsm End
70
+ ; X86-NEXT: retl
71
+ ;
72
+ ; X64-LABEL: test4:
73
+ ; X64: ## %bb.0: ## %entry
74
+ ; X64-NEXT: movq _y@GOTPCREL(%rip), %rcx
75
+ ; X64-NEXT: ## InlineAsm Start
76
+ ; X64-NEXT: movl (%rcx), %eax
77
+ ; X64-NEXT: ## InlineAsm End
78
+ ; X64-NEXT: retq
35
79
entry:
36
- ; CHECK-LABEL: test4:
37
- ; CHECK: movl L_y$non_lazy_ptr, %ecx
38
- ; CHECK: movl (%ecx), %eax
39
80
call void asm sideeffect "movl ${0:a}, %eax" , "ir,~{dirflag},~{fpsr},~{flags},~{eax}" (ptr @y ) nounwind
40
81
ret void
41
82
}
0 commit comments