1bbd431c49cfbeb6fa28ed917264a2c038eb43d4
[oota-llvm.git] / test / CodeGen / X86 / 2009-08-19-inline-asm-a-modifier.ll
1 ; RUN: llvm-as < %s | llc | 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"
5
6 define i32 @main() nounwind {
7 entry:
8 ; CHECK: %gs:6
9   %asmtmp.i = tail call i16 asm "movw\09%gs:${1:a}, ${0:w}", "=r,ir,~{dirflag},~{fpsr},~{flags}"(i32 6) nounwind ; <i16> [#uses=1]
10   %0 = zext i16 %asmtmp.i to i32                  ; <i32> [#uses=1]
11   ret i32 %0
12 }
13
14 define zeroext i16 @readgsword2(i32 %address) nounwind {
15 entry:
16 ; CHECK: %gs:(%eax)
17   %asmtmp = tail call i16 asm "movw\09%gs:${1:a}, ${0:w}", "=r,ir,~{dirflag},~{fpsr},~{flags}"(i32 %address) nounwind ; <i16> [#uses=1]
18   ret i16 %asmtmp
19 }