File: attr-weakref.c

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (67 lines) | stat: -rw-r--r-- 1,600 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// RUN: %clang_cc1 -emit-llvm -triple i386-linux-gnu -o - %s | FileCheck %s

// CHECK: declare extern_weak void @test1_f()
void test1_f(void);
static void test1_g(void) __attribute__((weakref("test1_f")));
void test1_h(void) {
  test1_g();
}

// CHECK-LABEL: define dso_local void @test2_f()
void test2_f(void) {}
static void test2_g(void) __attribute__((weakref("test2_f")));
void test2_h(void) {
  test2_g();
}

// CHECK: declare void @test3_f()
void test3_f(void);
static void test3_g(void) __attribute__((weakref("test3_f")));
void test3_foo(void) {
  test3_f();
}
void test3_h(void) {
  test3_g();
}

// CHECK-LABEL: define dso_local void @test4_f()
void test4_f(void);
static void test4_g(void) __attribute__((weakref("test4_f")));
void test4_h(void) {
  test4_g();
}
void test4_f(void) {}

// CHECK: declare void @test5_f()
void test5_f(void);
static void test5_g(void) __attribute__((weakref("test5_f")));
void test5_h(void) {
  test5_g();
}
void test5_foo(void) {
  test5_f();
}

// CHECK: declare extern_weak void @test6_f()
void test6_f(void) __attribute__((weak));
static void test6_g(void) __attribute__((weakref("test6_f")));
void test6_h(void) {
  test6_g();
}
void test6_foo(void) {
  test6_f();
}

// CHECK: declare extern_weak void @test8_f()
static void test8_g(void) __attribute__((weakref("test8_f")));
void test8_h(void) {
  if (test8_g)
    test8_g();
}
// CHECK: declare extern_weak void @test7_f()
void test7_f(void);
static void test7_g(void) __attribute__((weakref("test7_f")));
static void *const test7_zed = (void *) &test7_g;
void* test7_h(void) {
  return test7_zed;
}