// RUN: %clang_cc1 %s -triple=armv7-none-none-eabi -verify -Wunaligned-access -S -emit-llvm -o %t
// REQUIRES: arm-registered-target
//
// This test suite tests the warning triggered by the -Wunaligned-access option.
// The warning occurs when a struct or other type of record contains a field
// that is itself a record. The outer record must be a packed structure, while
// while the inner record must be unpacked. This is the fundamental condition
// for the warning to be triggered. Some of these tests may have three layers.
//
// The command line option -fsyntax-only is not used as Clang needs to be
// forced to layout the structs used in this test.
// The triple in the command line above is used for the assumptions about
// size and alignment of types.
// Packed-Unpacked Tests (No Pragma)
;
;
;
;
;
;
;
// Packed-Unpacked Tests with Pragma
;
;
;
;
// Packed-Packed Tests
;
;
;
// Unpacked-Packed Tests
;
;
// Unpacked-Unpacked Test
;
;
// Packed-Packed-Unpacked Test (No pragma)
;
;
;
;
// Packed-Unpacked-Packed tests
;
;
;
;
// Packed-Unpacked-Unpacked tests
;
;
;
;
// Unpacked-Packed-Packed test
;
;
// Unpacked-Packed-Unpacked tests
;
;
;
;
struct U1 s1;
struct U2 s2;
struct U3 s3;
struct U4 s4;
struct U5 s5;
struct U6 s6;
struct U7 s7;
struct U8 s8;
struct U9 s9;
struct U10 s10;
struct U11 s11;
struct U12 s12;
struct U13 s13;
struct U14 s14;
struct U15 s15;
struct U16 s16;
struct U17 s17;
struct U18 s18;
struct U19 s19;
struct U20 s20;
struct U21 s21;
struct U22 s22;
struct U23 s23;
struct U24 s24;