Files
clang-p2996/clang/test/Layout/dump-canonical.cpp
David Tenty 9964b0ef82 [clang] Add -fdump-record-layouts-canonical option
This option implies -fdump-record-layouts but dumps record layout information with canonical field types, which can be more useful in certain cases when comparing structure layouts.

Reviewed By: stevewan

Differential Revision: https://reviews.llvm.org/D105112
2021-07-05 17:35:37 -04:00

21 lines
436 B
C++

// RUN: %clang_cc1 -emit-llvm-only -fdump-record-layouts %s | FileCheck %s
// RUN: %clang_cc1 -emit-llvm-only -fdump-record-layouts-canonical %s | FileCheck %s -check-prefix CANONICAL
typedef long foo_t;
struct a {
foo_t x;
} b;
struct c {
typedef foo_t bar_t;
bar_t x;
} d;
// CHECK: 0 | foo_t
// CHECK: 0 | c::bar_t
// CANONICAL-NOT: 0 | foo_t
// CANONICAL-NOT: 0 | c::bar_t
// CANONICAL: 0 | long