From b69f9e0ab44e67ae4a36ab28e4e185078f2346ee Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Wed, 28 Aug 2013 23:56:07 +0000 Subject: use the last passed -munaligned-access / -mno-unaligned-access Passing inconsistent munaligned-access / mno-unaligned-access flags, intentionally resulted in a warning and the flag no-unaligned-access being used. Gcc does, at least in practice, use the last flag in such a case. This patch updates clang behaviour accordingly; use the last flag or base alignment behaviour on the target (which llvm will do if no flag is explicitly passed) Patch by Jeroen Hofstee. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189542 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Driver/arm-alignment.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/Driver/arm-alignment.c') diff --git a/test/Driver/arm-alignment.c b/test/Driver/arm-alignment.c index 024c46be74..dad66ba589 100644 --- a/test/Driver/arm-alignment.c +++ b/test/Driver/arm-alignment.c @@ -1,9 +1,25 @@ // RUN: %clang -target arm-none-gnueeabi -munaligned-access -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-UNALIGNED < %t %s +// RUN: %clang -target arm-none-gnueeabi -mstrict-align -munaligned-access -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-UNALIGNED < %t %s + +// RUN: %clang -target arm-none-gnueeabi -mno-unaligned-access -munaligned-access -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-UNALIGNED < %t %s + // CHECK-UNALIGNED: "-backend-option" "-arm-no-strict-align" + // RUN: %clang -target arm-none-gnueeabi -mno-unaligned-access -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s +// RUN: %clang -target arm-none-gnueeabi -mstrict-align -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s + +// RUN: %clang -target arm-none-gnueabi -munaligned-access -mno-unaligned-access -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s + +// RUN: %clang -target arm-none-gnueabi -munaligned-access -mstrict-align -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-ALIGNED < %t %s + // CHECK-ALIGNED: "-backend-option" "-arm-strict-align" -- cgit v1.2.1