aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/JS/getelementptr.ll
blob: 2dbb868b94e063d34e3f30226f3ab8c425765624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
; RUN: opt -S < %s -expand-getelementptr | llc -march=js | FileCheck %s

; Test simple getelementptr codegen.

target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128"

; CHECK: function _getelementptr([[VAL_P:\$[a-z_]+]]) {
; CHECK:  [[GEP:\$[a-z_]+]] = (([[GEPINT:\$[a-z_]+]]) + 588)|0;
define i32* @getelementptr([10 x [12 x i32] ]* %p) {
  %t = getelementptr [10 x [12 x i32]]* %p, i32 1, i32 2, i32 3
  ret i32* %t
}