1 // RUN: %clang_cc1 -triple=x86_64-unknown-linux -emit-llvm -frandomize-layout-seed=1234567890abcdef < %s | FileCheck %s
4 // Clang will add a forward declaration of "struct bar" and "enum qux" to the
5 // structures. This shouldn't prevent these structures from being randomized.
6 // So the 'f' element shouldn't be at the start of the structure anymore.
9 struct bar
*(*f
)(void);
10 struct bar
*(*g
)(void);
11 struct bar
*(*h
)(void);
12 struct bar
*(*i
)(void);
13 struct bar
*(*j
)(void);
14 struct bar
*(*k
)(void);
17 // CHECK-LABEL: define {{.*}}@t1(
18 // CHECK-NOT: getelementptr inbounds %struct.foo, ptr %3, i32 0, i32 0
19 struct bar
*t1(struct foo
*z
) {
32 // CHECK-LABEL: define {{.*}}@t2(
33 // CHECK-NOT: getelementptr inbounds %struct.baz, ptr %3, i32 0, i32 0
34 enum qux
*t2(struct baz
*z
) {