Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / redefine_extname.cpp
blobd17235e2301465095848039a35bebc31bada50b3
1 // RUN: %clang_cc1 -triple=i386-pc-solaris2.11 -w -emit-llvm %s -o - | FileCheck %s
3 extern "C" {
4 struct statvfs64 {
5 int f;
6 };
7 #pragma redefine_extname statvfs64 statvfs
8 int statvfs64(struct statvfs64 *);
11 void some_func() {
12 struct statvfs64 st;
13 statvfs64(&st);
14 // Check that even if there is a structure with redefined name before the
15 // pragma, subsequent function name redefined properly. PR5172, Comment 11.
16 // CHECK: call i32 @statvfs(ptr noundef %st)
19 // This is a case when redefenition is deferred *and* we have a local of the
20 // same name. PR23923.
21 #pragma redefine_extname foo bar
22 int f() {
23 int foo = 0;
24 return foo;
26 extern "C" {
27 int foo() { return 1; }
28 // CHECK: define{{.*}} i32 @bar()
31 // Check that #pragma redefine_extname applies to C code only, and shouldn't be
32 // applied to C++.
33 #pragma redefine_extname foo_cpp bar_cpp
34 extern int foo_cpp() { return 1; }
35 // CHECK-NOT: define{{.*}} i32 @bar_cpp()