brintos

brintos / llvm-project-archived public Read only

0
0
Text · 916 B · 3bec499 Raw
39 lines · c
1// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s2// PR 43493 4union reg5{6    unsigned char b[2][2];7    unsigned short w[2];8    unsigned int d;9};10struct cpu11{12    union reg pc;13};14extern struct cpu cpu;15struct svar16{17    void *ptr;18};19// CHECK: @svars1 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { ptr @cpu }]20struct svar svars1[] =21{22    { &((cpu.pc).w[0]) }23};24// CHECK: @svars2 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { ptr getelementptr (i8, ptr @cpu, i64 1) }]25struct svar svars2[] =26{27    { &((cpu.pc).b[0][1]) }28};29// CHECK: @svars3 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { ptr getelementptr (i8, ptr @cpu, i64 2) }]30struct svar svars3[] =31{32    { &((cpu.pc).w[1]) }33};34// CHECK: @svars4 = {{(dso_local )?}}global [1 x %struct.svar] [%struct.svar { ptr getelementptr (i8, ptr @cpu, i64 3) }]35struct svar svars4[] =36{37    { &((cpu.pc).b[1][1]) }38};39