diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:34:44 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:34:44 +0000 |
commit | 6b943ff3a3f8617113ecbf611cf0f8957e4e19d2 (patch) | |
tree | fc5f365fb9035b2d0c622bbf06c9bbe8627d7279 /test/Transforms/InstCombine/gep-addrspace.ll | |
parent | d0e4e96dc17a6c1c6de3340842c80f0e187ba349 (diff) |
Notes
Diffstat (limited to 'test/Transforms/InstCombine/gep-addrspace.ll')
-rw-r--r-- | test/Transforms/InstCombine/gep-addrspace.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/gep-addrspace.ll b/test/Transforms/InstCombine/gep-addrspace.ll new file mode 100644 index 0000000000000..dfe12dbfaf7f4 --- /dev/null +++ b/test/Transforms/InstCombine/gep-addrspace.ll @@ -0,0 +1,19 @@ +; RUN: opt < %s -instcombine -S + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" +target triple = "x86_64-pc-win32" + +%myStruct = type { float, [3 x float], [4 x float], i32 } + +; make sure that we are not crashing when creating an illegal type +define void @func(%myStruct addrspace(1)* nocapture %p) nounwind { +ST: + %A = getelementptr inbounds %myStruct addrspace(1)* %p, i64 0 + %B = bitcast %myStruct addrspace(1)* %A to %myStruct* + %C = getelementptr inbounds %myStruct* %B, i32 0, i32 1 + %D = getelementptr inbounds [3 x float]* %C, i32 0, i32 2 + %E = load float* %D, align 4 + %F = fsub float %E, undef + ret void +} + |