blob: f75b1c738b05cc417b800162c0f70385e61c1f2c [file] [log] [blame]
Daniel Dunbar568b7502010-08-13 04:44:20 +00001// Check that we don't try to forward -Xclang or -mlinker-version to GCC.
NAKAMURA Takumi053704f2013-08-19 11:51:51 +00002// PR12920 -- Check also we may not forward W_Group options to GCC.
Daniel Dunbar568b7502010-08-13 04:44:20 +00003//
Sebastian Pop422377c2012-01-20 22:01:23 +00004// RUN: %clang -target powerpc-unknown-unknown \
NAKAMURA Takumi053704f2013-08-19 11:51:51 +00005// RUN: %s \
6// RUN: -Wall -Wdocumentation \
Daniel Dunbar568b7502010-08-13 04:44:20 +00007// RUN: -Xclang foo-bar \
Eric Christopher63e31082016-01-07 01:23:19 +00008// RUN: -march=x86-64 \
Daniel Dunbar568b7502010-08-13 04:44:20 +00009// RUN: -mlinker-version=10 -### 2> %t
10// RUN: FileCheck < %t %s
11//
Eric Christopher63e31082016-01-07 01:23:19 +000012// clang -cc1
13// CHECK: clang
NAKAMURA Takumi053704f2013-08-19 11:51:51 +000014// CHECK: "-Wall" "-Wdocumentation"
NAKAMURA Takumi053704f2013-08-19 11:51:51 +000015// CHECK: "-o" "{{[^"]+}}.o"
16//
Eric Christopher63e31082016-01-07 01:23:19 +000017// gcc as ld.
NAKAMURA Takumi557fb622014-06-29 16:00:11 +000018// CHECK: gcc{{[^"]*}}"
NAKAMURA Takumi053704f2013-08-19 11:51:51 +000019// CHECK-NOT: "-mlinker-version=10"
20// CHECK-NOT: "-Xclang"
21// CHECK-NOT: "foo-bar"
22// CHECK-NOT: "-Wall"
23// CHECK-NOT: "-Wdocumentation"
NAKAMURA Takumi557fb622014-06-29 16:00:11 +000024// CHECK: -march
NAKAMURA Takumi053704f2013-08-19 11:51:51 +000025// CHECK-NOT: "-mlinker-version=10"
26// CHECK-NOT: "-Xclang"
27// CHECK-NOT: "foo-bar"
28// CHECK-NOT: "-Wall"
29// CHECK-NOT: "-Wdocumentation"
30// CHECK: "-o" "a.out"
Eric Christopher3db3a3b2016-01-07 01:23:12 +000031
32// Check that we're not forwarding -g options to the assembler
33// RUN: %clang -g -target x86_64-unknown-linux-gnu -no-integrated-as -c %s -### 2>&1 \
34// RUN: | FileCheck --check-prefix=CHECK-ASM %s
35// CHECK-ASM: as
36// CHECK-ASM-NOT: "-g"
Chad Rosier6df46f72018-04-11 14:20:37 +000037
38// Check that we're not forwarding -mno-unaligned-access.
39// RUN: %clang -target aarch64-none-elf -mno-unaligned-access %s -### 2>&1 \
40// RUN: | FileCheck --check-prefix=CHECK-ARM %s
41// CHECK-ARM: gcc{{[^"]*}}"
42// CHECK-ARM-NOT: -mno-unaligned-access