1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
14 // CHECK-LABEL: @_Z3fooP2ST(
16 // CHECK-NEXT: [[S_ADDR:%.*]] = alloca ptr, align 8
17 // CHECK-NEXT: store ptr [[S:%.*]], ptr [[S_ADDR]], align 8
18 // CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[S_ADDR]], align 8
19 // CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], ptr [[TMP0]], i64 1
20 // CHECK-NEXT: [[Z:%.*]] = getelementptr inbounds [[STRUCT_ST]], ptr [[ARRAYIDX]], i32 0, i32 2
21 // CHECK-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_RT:%.*]], ptr [[Z]], i32 0, i32 1
22 // CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [10 x [20 x i32]], ptr [[B]], i64 0, i64 5
23 // CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds [20 x i32], ptr [[ARRAYIDX1]], i64 0, i64 13
24 // CHECK-NEXT: ret ptr [[ARRAYIDX2]]
26 int *foo(struct ST *s) {
27 return &s[1].Z.B[5][13];