Puyan Lotfi | 678e19d | 2019-06-20 18:28:21 +0000 | [diff] [blame] | 1 | // REQUIRES: x86-registered-target |
Nico Weber | 6713f82 | 2019-10-03 02:38:43 +0000 | [diff] [blame] | 2 | // RUN: %clang -DINLINE=inline -target x86_64-unknown-linux-gnu -o - \ |
| 3 | // RUN: -emit-interface-stubs \ |
| 4 | // RUN: -interface-stub-version=experimental-ifs-v1 -std=gnu89 -xc %s | \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 5 | // RUN: FileCheck -check-prefix=CHECK-GNU %s |
| 6 | // RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -O0 -o - -c \ |
| 7 | // RUN: -std=gnu89 -xc %s | llvm-nm - | FileCheck -check-prefix=CHECK-GNU %s |
| 8 | |
Nico Weber | 6713f82 | 2019-10-03 02:38:43 +0000 | [diff] [blame] | 9 | // RUN: %clang -DINLINE="__attribute__((always_inline))" \ |
| 10 | // RUN: -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \ |
| 11 | // RUN: -interface-stub-version=experimental-ifs-v1 -xc %s | \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 12 | // RUN: FileCheck -check-prefix=CHECK-GNU %s |
| 13 | // RUN: %clang -DINLINE="__attribute__((always_inline))" \ |
| 14 | // RUN: -target x86_64-linux-gnu -O0 -o - -c -xc %s | \ |
| 15 | // RUN: llvm-nm - | FileCheck -check-prefix=CHECK-GNU %s |
| 16 | |
Nico Weber | 6713f82 | 2019-10-03 02:38:43 +0000 | [diff] [blame] | 17 | // RUN: %clang -DINLINE=inline -target x86_64-unknown-linux-gnu -o - \ |
| 18 | // RUN: -emit-interface-stubs \ |
| 19 | // RUN: -interface-stub-version=experimental-ifs-v1 -std=c99 -xc %s | \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 20 | // RUN: FileCheck -check-prefix=CHECK-STD %s |
| 21 | // RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -O0 -o - -c -std=c99 \ |
| 22 | // RUN: -xc %s | llvm-nm - 2>&1 | FileCheck -check-prefix=CHECK-STD %s |
| 23 | |
Nico Weber | 6713f82 | 2019-10-03 02:38:43 +0000 | [diff] [blame] | 24 | // RUN: %clang -DINLINE="__attribute__((noinline))" \ |
| 25 | // RUN: -target x86_64-unknown-linux-gnu -o - -emit-interface-stubs \ |
| 26 | // RUN: -interface-stub-version=experimental-ifs-v1 -std=c99 -xc %s | \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 27 | // RUN: FileCheck -check-prefix=CHECK-NOINLINE %s |
| 28 | // RUN: %clang -DINLINE="__attribute__((noinline))" -target x86_64-linux-gnu \ |
| 29 | // RUN: -O0 -o - -c -std=c99 -xc %s | llvm-nm - 2>&1 | \ |
| 30 | // RUN: FileCheck -check-prefix=CHECK-NOINLINE %s |
| 31 | |
Nico Weber | 6713f82 | 2019-10-03 02:38:43 +0000 | [diff] [blame] | 32 | // RUN: %clang -DINLINE="static" -target x86_64-unknown-linux-gnu -o - \ |
| 33 | // RUN: -emit-interface-stubs \ |
| 34 | // RUN: -interface-stub-version=experimental-ifs-v1 -std=c99 -xc %s | \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 35 | // RUN: FileCheck -check-prefix=CHECK-STATIC %s |
| 36 | // RUN: %clang -DINLINE="static" -target x86_64-linux-gnu -O0 -o - -c \ |
| 37 | // RUN: -std=c99 -xc %s | llvm-nm - 2>&1 | \ |
| 38 | // RUN: FileCheck -check-prefix=CHECK-STATIC %s |
| 39 | |
| 40 | // CHECK-GNU-DAG: foo |
| 41 | // CHECK-GNU-DAG: foo.var |
| 42 | // CHECK-NOINLINE-DAG: foo |
| 43 | // CHECK-NOINLINE-DAG: foo.var |
| 44 | // CHECK-STATIC-NOT: foo |
| 45 | // CHECK-STATIC-NOT: foo.var |
| 46 | // CHECK-STD-NOT: foo |
| 47 | #pragma clang diagnostic ignored "-Wstatic-local-in-inline" |
| 48 | INLINE int foo() { |
| 49 | static int var = 42; |
| 50 | return var; |
| 51 | } |
| 52 | |
Nico Weber | 6713f82 | 2019-10-03 02:38:43 +0000 | [diff] [blame] | 53 | // RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -o - \ |
| 54 | // RUN: -emit-interface-stubs -interface-stub-version=experimental-ifs-v1 \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 55 | // RUN: -std=gnu89 -xc %s | FileCheck -check-prefix=CHECK-TAPI %s |
| 56 | |
Nico Weber | 6713f82 | 2019-10-03 02:38:43 +0000 | [diff] [blame] | 57 | // RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -o - \ |
| 58 | // RUN: -emit-interface-stubs -interface-stub-version=experimental-ifs-v1 \ |
Puyan Lotfi | 68f29da | 2019-06-20 16:59:48 +0000 | [diff] [blame] | 59 | // RUN: -std=gnu89 -xc %s | FileCheck -check-prefix=CHECK-SYMBOLS %s |
| 60 | // RUN: %clang -DINLINE=inline -target x86_64-linux-gnu -o - \ |
| 61 | // RUN: -c -std=gnu89 -xc %s | llvm-nm - 2>&1 | \ |
| 62 | // RUN: FileCheck -check-prefix=CHECK-SYMBOLS %s |
| 63 | |
| 64 | // CHECK-TAPI-DAG: foo: { Type: Func } |
| 65 | // CHECK-TAPI-DAG: foo.var: { Type: Object, Size: 4 } |
| 66 | // CHECK-SYMBOLS-DAG: foo |
| 67 | // CHECK-SYMBOLS-DAG: foo.var |
| 68 | #include "inline.h" |