diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -2189,6 +2189,8 @@ HelpText<"Specify the boundary's size to align branches">; def mpad_max_prefix_size_EQ : Joined<["-"], "mpad-max-prefix-size=">, Group, Flags<[DriverOption]>, HelpText<"Specify maximum number of prefixes to use for padding">; +def malign_branch_prefix_size_EQ : Joined<["-"], "malign-branch-prefix-size=">, Group, Flags<[DriverOption]>, Alias, + HelpText<"Alias for -mpad-max-prefix-size">;// Alias for GCC compatibility def mbranches_within_32B_boundaries : Flag<["-"], "mbranches-within-32B-boundaries">, Flags<[DriverOption]>, Group, HelpText<"Align selected branches (fused, jcc, jmp) within 32-byte boundary">; def mfancy_math_387 : Flag<["-"], "mfancy-math-387">, Group; diff --git a/clang/test/Driver/x86-malign-branch.c b/clang/test/Driver/x86-malign-branch.c --- a/clang/test/Driver/x86-malign-branch.c +++ b/clang/test/Driver/x86-malign-branch.c @@ -24,6 +24,9 @@ // RUN: %clang -target x86_64 -mpad-max-prefix-size=15 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX-15 // PREFIX-15: "-mllvm" "-x86-pad-max-prefix-size=15" +/// Test -malign-branch-prefix-size= for GCC compatibilty +// RUN: %clang -target x86_64 -malign-branch-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX-5 + /// Test -mbranches-within-32B-boundaries // RUN: %clang -target x86_64 -mbranches-within-32B-boundaries %s -c -### 2>&1 | FileCheck %s --check-prefix=32B // 32B: "-mllvm" "-x86-branches-within-32B-boundaries" diff --git a/clang/test/Driver/x86-malign-branch.s b/clang/test/Driver/x86-malign-branch.s --- a/clang/test/Driver/x86-malign-branch.s +++ b/clang/test/Driver/x86-malign-branch.s @@ -9,5 +9,7 @@ // RUN: %clang -target x86_64 -mpad-max-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX // PREFIX: "-mllvm" "-x86-pad-max-prefix-size=5" +// RUN: %clang -target x86_64 -malign-branch-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX + // RUN: %clang -target x86_64 -mbranches-within-32B-boundaries %s -c -### 2>&1 | FileCheck %s --check-prefix=32B // 32B: "-mllvm" "-x86-branches-within-32B-boundaries"