llvm-project/clang/test/Driver/darwin-debug-flags.c
Cyndy Ishida 752adc36ef
[clang][Darwin] Simplify deployment version assignment in the Driver (#142013)
To be able to handle all of the ways the platform & deployment version
can be represented in command line flags, the Darwin toolchain holds a
type `DarwinPlatform` to help represent them. This patch simplifies the
logic by:
* reducing the amount of work done between string & version tuples
conversions
* renaming variables to reduce confusion about what target triple
information is being manipulated.
* allowing implicit transformation of macOS10.16 -> 11, there are other
places in the compiler where this happens, and it was a bit confusing
that the driver didn't do that for the cc1 call.

This is not a major refactor, but more simple & common tweaks across the
file, in hopes to make it more readable.
2025-06-05 11:37:51 -07:00

17 lines
656 B
C

// RUN: env RC_DEBUG_OPTIONS=1 %clang -target i386-apple-darwin11 -I "path with \spaces" -g -Os %s -emit-llvm -S -o - | FileCheck %s
// RUN: touch %t.s
// RUN: env RC_DEBUG_OPTIONS=1 %clang -### -target i386-apple-darwin11 -c -g %t.s 2>&1 | FileCheck -check-prefix=S %s
// RUN: %clang -### -target i386-apple-darwin11 -c -g %t.s 2>&1 | FileCheck -check-prefix=P %s
// CHECK: distinct !DICompileUnit(
// CHECK-SAME: flags:
// CHECK-SAME: -I path\\ with\\ \\\\spaces
// CHECK-SAME: -g -Os
// CHECK-SAME: -mmacos-version-min=10.7
int x;
// S: "-dwarf-debug-flags"
// P: "-dwarf-debug-producer"