]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test/suites/nvcc.bash: Test -x cu and -dc options
authorAlexander Korsunsky <alexander.korsunsky@rcpe.at>
Wed, 17 Apr 2019 16:55:44 +0000 (18:55 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 31 Jul 2019 19:18:55 +0000 (21:18 +0200)
test/suites/nvcc.bash

index 3b713c0dc402c4276d98806761fc8464b2e34637..3ee5c31785fc252780838e0708b8e47f933fa606 100644 (file)
@@ -53,7 +53,7 @@ nvcc_tests() {
     # instead of comparing the binary object files, we compare the dumps of
     # "cuobjdump -all -elf -symbols -ptx -sass test1.o".
     nvcc_opts_cpp="-Wno-deprecated-gpu-targets -c --x c++"
-    nvcc_opts_cuda="-Wno-deprecated-gpu-targets -c"
+    nvcc_opts_cuda="-Wno-deprecated-gpu-targets -c -x cu"
     nvcc_opts_gpu1="--generate-code arch=compute_50,code=compute_50"
     nvcc_opts_gpu2="--generate-code arch=compute_52,code=sm_52"
     ccache_nvcc_cpp="$CCACHE $REAL_NVCC $nvcc_opts_cpp"
@@ -127,6 +127,26 @@ nvcc_tests() {
     expect_stat 'files in cache' 3
     $cuobjdump test_cuda.o > test1.dump
     expect_equal_files reference_test3.dump test1.dump
+    
+    # -------------------------------------------------------------------------
+    TEST "Option -dc"
+    
+    $REAL_NVCC $nvcc_opts_cuda -dc -o reference_test4.o test_cuda.cu
+    $cuobjdump reference_test4.o > reference_test4.dump
+
+    $ccache_nvcc_cuda -dc -o test_cuda.o test_cuda.cu
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 1
+    expect_stat 'files in cache' 1
+    $cuobjdump test_cuda.o > test4.dump
+    expect_equal_files test4.dump reference_test4.dump
+
+    $ccache_nvcc_cuda -dc -o test_cuda.o test_cuda.cu
+    expect_stat 'cache hit (preprocessed)' 1
+    expect_stat 'cache miss' 1
+    expect_stat 'files in cache' 1
+    $cuobjdump test_cuda.o > test4.dump
+    expect_equal_files test4.dump reference_test4.dump
 
     # -------------------------------------------------------------------------
     TEST "Different defines"