45 lines · c
1// RUN: %clang -### -S %s 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s2// RUN: %clang -### -S %s -g -target x86_64-linux-gnu 2>&1 \3// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s4 5// Assert that the toolchains which should default to a lower Dwarf version do so.6// RUN: %clang -### -S %s -g -target x86_64-apple-darwin8 2>&1 \7// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s8// RUN: %clang -### -S %s -g -target i686-pc-openbsd 2>&1 \9// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s10// RUN: %clang -### -S %s -g -target x86_64-pc-freebsd 2>&1 \11// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF4 %s12// RUN: %clang -### -S %s -g --target=x86_64-unknown-haiku 2>&1 \13// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF4 %s14 15// 'g0' is the default. Just basic correctness check that it does nothing16// RUN: %clang -### -S %s -g0 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s17 18// And check that the last of -g or -g0 wins.19// RUN: %clang -### -S %s -g -g0 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s20 21// These should be semantically the same as not having given 'g0' at all,22// as the last 'g' option wins.23//24// RUN: %clang -### -S %s -g0 -g -target x86_64-linux-gnu 2>&1 \25// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s26// RUN: %clang -### -S %s -g0 -g -target x86_64-apple-darwin8 2>&1 \27// RUN: | FileCheck --check-prefix=CHECK-WITH-G-STANDALONE %s28// RUN: %clang -### -S %s -g0 -g -target i686-pc-openbsd 2>&1 \29// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s30// RUN: %clang -### -S %s -g0 -g -target x86_64-pc-freebsd 2>&1 \31// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF4 %s32// RUN: %clang -### -S %s -g0 -g --target=x86_64-unknown-haiku 2>&1 \33// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF4 %s34// RUN: %clang -### -S %s -g0 -g --target=i386-pc-solaris 2>&1 \35// RUN: | FileCheck --check-prefix=CHECK-WITH-G %s36 37// CHECK-WITHOUT-G-NOT: -debug-info-kind38// CHECK-WITH-G: "-debug-info-kind=constructor"39// CHECK-WITH-G: "-dwarf-version=5"40// CHECK-WITH-G-DWARF4: "-dwarf-version=4"41// CHECK-WITH-G-DWARF2: "-dwarf-version=2"42 43// CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone"44// CHECK-WITH-G-STANDALONE: "-dwarf-version=2"45