mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-17 06:16:07 +00:00

This implements support for the previously ignored flag `-falign-functions`. This allows the frontend to request alignment on function definitions in the translation unit where they are not explicitly requested in code. This is compatible with the GCC behaviour and the ICC behaviour. The scalar value passed to `-falign-functions` aligns functions to a power-of-two boundary. If flag is used, the functions are aligned to 16-byte boundaries. If the scalar is specified, it must be an integer less than or equal to 4096. If the value is not a power-of-two, the driver will round it up to the nearest power of two. llvm-svn: 330378
18 lines
1.0 KiB
C
18 lines
1.0 KiB
C
// RUN: %clang -### %s 2>&1 | FileCheck %s -check-prefix CHECK-0
|
|
// RUN: %clang -### -falign-functions %s 2>&1 | FileCheck %s -check-prefix CHECK-1
|
|
// RUN: %clang -### -falign-functions=1 %s 2>&1 | FileCheck %s -check-prefix CHECK-1
|
|
// RUN: %clang -### -falign-functions=2 %s 2>&1 | FileCheck %s -check-prefix CHECK-2
|
|
// RUN: %clang -### -falign-functions=3 %s 2>&1 | FileCheck %s -check-prefix CHECK-3
|
|
// RUN: %clang -### -falign-functions=4 %s 2>&1 | FileCheck %s -check-prefix CHECK-4
|
|
// RUN: %clang -### -falign-functions=65537 %s 2>&1 | FileCheck %s -check-prefix CHECK-ERR-65537
|
|
// RUN: %clang -### -falign-functions=a %s 2>&1 | FileCheck %s -check-prefix CHECK-ERR-A
|
|
|
|
// CHECK-0-NOT: "-function-alignment"
|
|
// CHECK-1-NOT: "-function-alignment"
|
|
// CHECK-2: "-function-alignment" "1"
|
|
// CHECK-3: "-function-alignment" "2"
|
|
// CHECK-4: "-function-alignment" "2"
|
|
// CHECK-ERR-65537: error: invalid integral value '65537' in '-falign-functions=65537'
|
|
// CHECK-ERR-A: error: invalid integral value 'a' in '-falign-functions=a'
|
|
|