155 lines · plain
1// PR21000: Test that -I is passed to both external and integrated assemblers.2 3// RUN: %clang --target=x86_64-linux-gnu -c -no-integrated-as %s \4// RUN: -Ifoo_dir -### 2>&1 \5// RUN: | FileCheck %s6 7// RUN: %clang --target=x86_64-linux-gnu -c -no-integrated-as %s \8// RUN: -I foo_dir -### 2>&1 \9// RUN: | FileCheck %s10 11// RUN: %clang --target=x86_64-linux-gnu -c -integrated-as %s \12// RUN: -Ifoo_dir -### 2>&1 \13// RUN: | FileCheck %s14 15// RUN: %clang --target=x86_64-linux-gnu -c -integrated-as %s \16// RUN: -I foo_dir -### 2>&1 \17// RUN: | FileCheck %s18 19// Other GNU targets20 21// RUN: %clang --target=aarch64-linux-gnu -c -no-integrated-as %s \22// RUN: -Ifoo_dir -### 2>&1 \23// RUN: | FileCheck %s24 25// RUN: %clang --target=aarch64-linux-gnu -c -integrated-as %s \26// RUN: -Ifoo_dir -### 2>&1 \27// RUN: | FileCheck %s28 29// RUN: %clang --target=armv7-linux-gnueabihf -c -no-integrated-as %s \30// RUN: -Ifoo_dir -### 2>&1 \31// RUN: | FileCheck %s32 33// RUN: %clang --target=armv7-linux-gnueabihf -c -integrated-as %s \34// RUN: -Ifoo_dir -### 2>&1 \35// RUN: | FileCheck %s36 37// CHECK: "-I" "foo_dir"38 39// Test that assembler options don't cause warnings when there's no assembler40// stage.41 42// RUN: %clang -mincremental-linker-compatible -E -fintegrated-as \43// RUN: -o /dev/null -x c++ %s 2>&1 \44// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s45// RUN: %clang -mincremental-linker-compatible -E -fno-integrated-as \46// RUN: -o /dev/null -x c++ %s 2>&1 \47// RUN: | FileCheck --check-prefix=WARN --allow-empty %s48 49// RUN: %clang -mincremental-linker-compatible -E -fintegrated-as \50// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \51// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s52// RUN: %clang -mincremental-linker-compatible -E -fno-integrated-as \53// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \54// RUN: | FileCheck --check-prefix=WARN --allow-empty %s55 56// RUN: %clang -mimplicit-it=always --target=armv7-linux-gnueabi -E \57// RUN: -fintegrated-as -o /dev/null -x c++ %s 2>&1 \58// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s59// RUN: %clang -mimplicit-it=always --target=armv7-linux-gnueabi -E \60// RUN: -fno-integrated-as -o /dev/null -x c++ %s 2>&1 \61// RUN: | FileCheck --check-prefix=WARN --allow-empty %s62 63// RUN: %clang -mimplicit-it=always --target=armv7-linux-gnueabi -E \64// RUN: -fintegrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \65// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s66// RUN: %clang -mimplicit-it=always --target=armv7-linux-gnueabi -E \67// RUN: -fno-integrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \68// RUN: | FileCheck --check-prefix=WARN --allow-empty %s69 70// RUN: %clang -Wa,-mbig-obj --target=i386-pc-windows -E -fintegrated-as \71// RUN: -o /dev/null -x c++ %s 2>&1 \72// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s73// RUN: %clang -Wa,-mbig-obj --target=i386-pc-windows -E -fno-integrated-as \74// RUN: -o /dev/null -x c++ %s 2>&1 \75// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s76 77// RUN: %clang -Wa,-mbig-obj --target=i386-pc-windows -E -fintegrated-as \78// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \79// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s80// RUN: %clang -Wa,-mbig-obj --target=i386-pc-windows -E -fno-integrated-as \81// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \82// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s83 84// RUN: %clang -Xassembler -mbig-obj --target=i386-pc-windows -E -fintegrated-as \85// RUN: -o /dev/null -x c++ %s 2>&1 \86// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s87// RUN: %clang -Xassembler -mbig-obj --target=i386-pc-windows -E \88// RUN: -fno-integrated-as -o /dev/null -x c++ %s 2>&1 \89// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s90 91// RUN: %clang -Xassembler -mbig-obj --target=i386-pc-windows -E -fintegrated-as \92// RUN: -o /dev/null -x assembler-with-cpp %s 2>&1 \93// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s94// RUN: %clang -Xassembler -mbig-obj --target=i386-pc-windows -E \95// RUN: -fno-integrated-as -o /dev/null -x assembler-with-cpp %s 2>&1 \96// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s97 98// NOWARN-NOT: unused99 100// Test that unsupported arguments do not cause errors when -fno-integrated-as101// is set.102// RUN: %clang -Wa,-mno-warn-deprecated -fno-integrated-as %s -S 2>&1 \103// RUN: | FileCheck --check-prefix=NOERROR --allow-empty %s104// NOERROR-NOT: error: unsupported argument '-mno-warn-deprecated' to option 'Wa,'105 106// -Wa flags shouldn't cause warnings without an assembler stage with107// -fno-integrated-as either.108// RUN: %clang -Wa,-mno-warn-deprecated -fno-integrated-as -x c++ %s -S 2>&1 \109// RUN: -o /dev/null \110// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s111 112// But -m flags for the integrated assembler _should_ warn if the integrated113// assembler is not in use.114// RUN: %clang -mrelax-all -fintegrated-as -x c++ %s -S -o /dev/null 2>&1 \115// RUN: | FileCheck --check-prefix=NOWARN --allow-empty %s116// RUN: %clang -mrelax-all -fno-integrated-as -x c++ %s -S -o /dev/null 2>&1 \117// RUN: | FileCheck --check-prefix=WARN --allow-empty %s118// WARN: unused119 120// Test that -g is passed through to GAS.121// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -g %s -### 2>&1 | \122// RUN: FileCheck --check-prefix=DEBUG %s123// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -g0 -g %s -### 2>&1 | \124// RUN: FileCheck --check-prefix=DEBUG %s125// DEBUG: "-g" "-gdwarf-5"126// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -g -g0 %s -### 2>&1 | \127// RUN: FileCheck --check-prefix=NODEBUG %s128// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-5 -g0 %s -### 2>&1 | \129// RUN: FileCheck --check-prefix=NODEBUG %s130// NODEBUG-NOT: "-g"131// NODEBUG-NOT: "-gdwarf-132 133// Test that -gdwarf-* is passed through to GAS.134// TODO: test without -g135// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-5 %s -### 2>&1 | \136// RUN: FileCheck --check-prefix=GDWARF5 %s137// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-4 %s -### 2>&1 | \138// RUN: FileCheck --check-prefix=GDWARF4 %s139// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-3 %s -### 2>&1 | \140// RUN: FileCheck --check-prefix=GDWARF3 %s141// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-2 %s -### 2>&1 | \142// RUN: FileCheck --check-prefix=GDWARF2 %s143// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf %s -### 2>&1 | \144// RUN: FileCheck --check-prefix=GDWARF5 %s145 146// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -gdwarf-5 %s -### 2>&1 | \147// RUN: FileCheck --check-prefix=GDWARF5 %s148// RUN: %clang --target=aarch64-linux-gnu -fno-integrated-as -g \149// RUN: -fdebug-default-version=2 %s -### 2>&1 | FileCheck --check-prefix=GDWARF2 %s150 151// GDWARF5: "-gdwarf-5"152// GDWARF4: "-gdwarf-4"153// GDWARF3: "-gdwarf-3"154// GDWARF2: "-gdwarf-2"155