mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 13:36:09 +00:00

A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the eleventh batch of tests being updated (there are a significant number of other tests left to be updated).
31 lines
1.2 KiB
C
31 lines
1.2 KiB
C
// REQUIRES: x86-registered-target
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -o - < %s | FileCheck %s --check-prefix=PLAIN
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -ffunction-sections -o - < %s | FileCheck %s --check-prefix=FUNC_SECT
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT
|
|
|
|
// Try again through a clang invocation of the ThinLTO backend.
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O2 %s -flto=thin -emit-llvm-bc -o %t.o
|
|
// RUN: llvm-lto -thinlto -o %t %t.o
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -S -ffunction-sections -o - | FileCheck %s --check-prefix=FUNC_SECT
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -S -fdata-sections -o - | FileCheck %s --check-prefix=DATA_SECT
|
|
|
|
const int hello = 123;
|
|
void world(void) {}
|
|
|
|
// PLAIN-NOT: section
|
|
// PLAIN: world:
|
|
// PLAIN: section .rodata,
|
|
// PLAIN: hello:
|
|
|
|
// FUNC_SECT: section .text.world,
|
|
// FUNC_SECT: world:
|
|
// FUNC_SECT: section .rodata,
|
|
// FUNC_SECT: hello:
|
|
|
|
// DATA_SECT-NOT: .section
|
|
// DATA_SECT: world:
|
|
// DATA_SECT: .section .rodata.hello,
|
|
// DATA_SECT: hello:
|