llvm-project/clang/test/CodeGenCXX/2008-05-07-CrazyOffsetOf.cpp
Alex Richardson a18181931f [NFC][clang] Add a CHECK lines to tests checking offsetof-like expressions
I am looking at constant-folding changes that could affect these tests, so
check that it emits the expected global value instead of just checking
that it doesn't crash.
2021-09-28 17:57:36 +01:00

10 lines
276 B
C++

// RUN: %clang_cc1 -triple=x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s
// rdar://5914926
struct bork {
struct bork *next_local;
char * query;
};
int offset = (char *) &(((struct bork *) 0x10)->query) - (char *) 0x10;
// CHECK: @offset = global i32 8, align 4