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
54
65define i32 @test1 () nounwind {
7- entry:
86; 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:
1014 %asmtmp.i = tail call i16 asm "movw\09 %gs:${1:a}, ${0:w}" , "=r,ir,~{dirflag},~{fpsr},~{flags}" (i32 6 ) nounwind ; <i16> [#uses=1]
1115 %0 = zext i16 %asmtmp.i to i32 ; <i32> [#uses=1]
1216 ret i32 %0
1317}
1418
1519define 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
1636entry:
17- ; CHECK-LABEL: test2:
18- ; CHECK: movw %gs:(%eax), %ax
1937 %asmtmp = tail call i16 asm "movw\09 %gs:${1:a}, ${0:w}" , "=r,ir,~{dirflag},~{fpsr},~{flags}" (i32 %address ) nounwind ; <i16> [#uses=1]
2038 ret i16 %asmtmp
2139}
@@ -24,18 +42,41 @@ entry:
2442@y = common global i32 0 ; <ptr> [#uses=3]
2543
2644define 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
2758entry:
28- ; CHECK-LABEL: test3:
29- ; CHECK: movl _n, %eax
3059 call void asm sideeffect "movl ${0:a}, %eax" , "ir,~{dirflag},~{fpsr},~{flags},~{eax}" (ptr @n ) nounwind
3160 ret void
3261}
3362
3463define 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
3579entry:
36- ; CHECK-LABEL: test4:
37- ; CHECK: movl L_y$non_lazy_ptr, %ecx
38- ; CHECK: movl (%ecx), %eax
3980 call void asm sideeffect "movl ${0:a}, %eax" , "ir,~{dirflag},~{fpsr},~{flags},~{eax}" (ptr @y ) nounwind
4081 ret void
4182}
0 commit comments